Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails
Дата
Msg-id 202407191318.uecnw7oaidhu@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails  (Tender Wang <tndrwang@gmail.com>)
Ответы Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails
Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails
Список pgsql-hackers
Hello,

I think the fix for the check triggers should be as the attached.  Very
close to what you did, but you were skipping some operations that needed
to be kept.  AFAICS this patch works correctly for the posted cases.

I haven't looked at the action triggers yet; I think we need to create
one trigger for each partition of the referenced side, so we need to
loop instead of doing a single one.



I find this pair of queries useful; they show which constraints exist
and which triggers belong to each.  We need to make the constraints and
triggers match after a detach right as things would be if the
just-detached partition were an individual table having the same foreign
key.


-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"People get annoyed when you try to debug them."  (Larry Wall)

Вложения

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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Can we use parallel workers to create index without active/transaction snapshot?
Следующее
От: Christoph Berg
Дата:
Сообщение: Re: Set log_lock_waits=on by default