Re: BUG #16177: pg_event_trigger_ddl_commands() returns empty setfor ddl_command_start and "drop table"

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: BUG #16177: pg_event_trigger_ddl_commands() returns empty setfor ddl_command_start and "drop table"
Дата
Msg-id 20191223143638.GA16273@alvherre.pgsql
обсуждение исходный текст
Ответ на BUG #16177: pg_event_trigger_ddl_commands() returns empty set for ddl_command_start and "drop table"  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #16177: pg_event_trigger_ddl_commands() returns empty set forddl_command_start and "drop table"  (Andrei Pozolotin <andrei.pozolotin@gmail.com>)
Список pgsql-bugs
On 2019-Dec-22, PG Bug reporting form wrote:

> 1. use case is to delete rows with oid references  to the table before "drop
> table"

I think you could achieve that with an event trigger on event sql_drop.
IIRC that event trigger is run for the objects before the drops are
actually executed.

ddl_command_start is pretty useless, because it doesn't have much info
abot the command being run; I'm sure that
pg_event_trigger_ddl_commands() would always return empty there.
The function would return non-empty only during ddl_command_end, but
that's no useful to you because the drops will already have run.

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



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16178: DROP LANGUAGE plpythonu; doesn't actually drop language.
Следующее
От: Andrei Pozolotin
Дата:
Сообщение: Re: BUG #16177: pg_event_trigger_ddl_commands() returns empty set forddl_command_start and "drop table"