Firing an event trigger for ADD COLUMN?

Поиск
Список
Период
Сортировка
От Michel Pelletier
Тема Firing an event trigger for ADD COLUMN?
Дата
Msg-id CACxu=vL+dbVnzUSa=ZhLj9XfTib5+0HWGcHfSJCrAVN-u8CpPg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Firing an event trigger for ADD COLUMN?
Re: Firing an event trigger for ADD COLUMN?
Список pgsql-general
I'm writing a script that "reverses" ddl operations in an "up" script by capturing event triggers and generating a "down" script for reverting.  I've got it working great for tables, indexes, etc, but it seems ADD COLUMN doesn't sent an event, here's the code i'm using, pasted straight from the documentation:


And here's the results I get, I get an event for dropping a column, but not adding one:

postgres=# create table foo (bar int);
NOTICE:  CREATE TABLE created object: table public public.foo
CREATE TABLE
postgres=# alter table foo add column baz int;
NOTICE:  ALTER TABLE created object: table public public.foo
ALTER TABLE
postgres=# alter table foo drop column bar;
NOTICE:  ALTER TABLE dropped object: table column public.<NULL> public.foo.bar
NOTICE:  ALTER TABLE created object: table public public.foo
ALTER TABLE
postgres=#

Is this asymmetry a bug?  I realize these event trigger functions are typically written in C, but I'd like to keep this idea contained to a plpgsql function and cover as many reversible changes as I can.

Thank you,

-Michel

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Upgrade Process Says "The database server was not shut downcleanly" but it was
Следующее
От: Tanveer Munavar
Дата:
Сообщение: Re: Firing an event trigger for ADD COLUMN?