Re: Is there a way to be notified on the CREATE TABLE execution?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Is there a way to be notified on the CREATE TABLE execution?
Дата
Msg-id 20180620200242.zfiwrulsieuyao25@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Is there a way to be notified on the CREATE TABLE execution?  (Igor Korot <ikorot01@gmail.com>)
Список pgsql-general
On 2018-Jun-20, Igor Korot wrote:

> [quote]
> In order to create an event trigger, you must first create a function
> with the special return type event_trigger. This function need not
> (and may not) return a value; the return type serves merely as a
> signal that the function is to be invoked as an event trigger.
> [/quote]
> 
> So, the function has to be created and compiled.

Event trigger functions can be written in plpgsql.  You can use
pg_event_trigger_ddl_commands() in the ddl_command_end event to obtain a
few tidbits about the DDL that was just executed.

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


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Postgres 10.4 crashing when using PLV8
Следующее
От: Mukesh Chhatani
Дата:
Сообщение: Re: Postgres 10.4 crashing when using PLV8