From 3f190f67eb45ae61d696fbce8ab48d246a12f709 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Fri, 27 Feb 2015 18:38:33 -0300 Subject: 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. --- src/backend/commands/event_trigger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/commands/event_trigger.c') diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c index dcf5b987477..deeb8dcfaf1 100644 --- a/src/backend/commands/event_trigger.c +++ b/src/backend/commands/event_trigger.c @@ -326,7 +326,8 @@ validate_table_rewrite_tags(const char *filtervar, List *taglist) static event_trigger_command_tag_check_result check_table_rewrite_ddl_tag(const char *tag) { - if (pg_strcasecmp(tag, "ALTER TABLE") == 0) + if (pg_strcasecmp(tag, "ALTER TABLE") == 0 || + pg_strcasecmp(tag, "ALTER TYPE") == 0) return EVENT_TRIGGER_COMMAND_TAG_OK; return EVENT_TRIGGER_COMMAND_TAG_NOT_SUPPORTED; -- cgit v1.2.3