pgsql: Fix table_rewrite event trigger for ALTER TYPE/SET DATA TYPE CAS

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix table_rewrite event trigger for ALTER TYPE/SET DATA TYPE CAS
Date: 2015-02-27 21:40:26
Message-ID: E1YRSe2-0004GN-KY@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix table_rewrite event trigger for ALTER TYPE/SET DATA TYPE CASCADE

When a composite type being used in a typed table is modified by way
of ALTER TYPE, a table rewrite occurs appearing to come from ALTER TYPE.
The existing event_trigger.c code was unable to cope with that
and raised a spurious error. The fix is just to accept that command
tag for the event, and document this properly.

Noted while fooling with deparsing of DDL commands. This appears to be
an oversight in commit 618c9430a.

Thanks to Mark Wong for documentation wording help.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3f190f67eb45ae61d696fbce8ab48d246a12f709

Modified Files
--------------
doc/src/sgml/event-trigger.sgml | 9 ++++-----
src/backend/commands/event_trigger.c | 3 ++-
src/test/regress/expected/event_trigger.out | 11 +++++++++++
src/test/regress/sql/event_trigger.sql | 10 ++++++++++
4 files changed, 27 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2015-02-27 21:59:23 pgsql: Fix a couple of trivial issues in jsonb.c
Previous Message Andrew Dunstan 2015-02-26 17:35:27 pgsql: Render infinite date/timestamps as 'infinity' for json/jsonb