Re: getting ERROR "relation 16401 has no triggers" with partitionforeign key alter

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: getting ERROR "relation 16401 has no triggers" with partitionforeign key alter
Дата
Msg-id 20190717220847.GA12100@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: getting ERROR "relation 16401 has no triggers" with partition foreign key alter  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: getting ERROR "relation 16401 has no triggers" with partitionforeign key alter  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On 2019-Jul-16, Tom Lane wrote:

> Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com> writes:
> > I am getting ERROR:  relation 16401 has no triggers error while executing
> > below query.
> 
> Yeah, I can reproduce that back to v11.  If you try the same scenario
> with a non-partitioned table you get
> 
> ERROR:  55006: cannot ALTER TABLE "tbl2" because it has pending trigger events
> LOCATION:  CheckTableNotInUse, tablecmds.c:3436
> 
> but that test evidently fails to detect pending events for a partition
> child table.

Ah, yeah.  So the problem is that when dropping an FK,
ATExecDropConstraint does not recurse itself, but instead relies on the
dependency mechanism, which obviously does not run CheckTableNotInUse on
the partitions.

I think we should just run CheckTableNotInUse for each partition in
ATExecDropConstraint.  Trying that out now.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: pg_receivewal documentation
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: getting ERROR "relation 16401 has no triggers" with partitionforeign key alter