Re: Ris: BUG #15482: Foreign keys to a partition (NOT A PARTITIONED)break the server

Поиск
Список
Период
Сортировка
От Ing. Gianluca Alberici
Тема Re: Ris: BUG #15482: Foreign keys to a partition (NOT A PARTITIONED)break the server
Дата
Msg-id aa26c31c-bacd-d21e-8325-503e39a1c723@abinetworks.biz
обсуждение исходный текст
Ответ на Re: Ris: BUG #15482: Foreign keys to a partition (NOT A PARTITIONED)break the server  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Ris: BUG #15482: Foreign keys to a partition (NOT A PARTITIONED) break the server  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs

Alvaro,

Actually it is a strange behavior, look at this:

abi2=> begin;
BEGIN
abi2=> delete from _abi_main_pof_t where poftid=1843635;
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!> \q
root@wnet0:~# psql -Uphoebe abi2 -p5433
psql (11.0 (Debian 11.0-1.pgdg90+2))
Type "help" for help.

abi2=> vacuum full analyze _abi_main_pof_t;
VACUUM
abi2=> vacuum full analyze _abi_main_pof_r;
VACUUM
abi2=> begin;
BEGIN
abi2=> delete from _abi_main_pof_t where poftid=1843635;
ERROR:  update or delete on table "_abi_main_pof_t" violates foreign key constraint "_abi_main_pof_t_refid_fkey" on table "_abi_main_pof_t"
DETAIL:  Key (poftid)=(1843635) is still referenced from table "_abi_main_pof_t".
abi2=>

Now, these two tables were originally normal tables with huge data in it.

They were added a pi (partition index) field to be child of a master partitioned by range.

A master table were created and a 'brother' table too to host 'unused records'.

Tables were put toghether and by updating pi's records were moved around child tables.

This were done by removing triggers and fk's to speed up moving process.

Then keys and triggers were rebuilt and the problem arised.

After vacuuming as you can see...

I will repeat the whole 'migration' process the next days and see if it happens again. If you want i can set up a user account on this machine to play with this better than i could.

I think it could be useful to investigate the overall stability of the server.

Let me know if youre interested in it.

Best Regards,

G

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Andriy Bartash
Дата:
Сообщение: Update on bug #15468
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #15437: Segfault during insert into declarative partitionedtable with a trigger creating partition