bdr/deparse: don't use TG_TAG
authorAlvaro Herrera <[email protected]>
Tue, 29 Apr 2014 18:07:04 +0000 (14:07 -0400)
committerAndres Freund <[email protected]>
Thu, 3 Jul 2014 15:55:29 +0000 (17:55 +0200)
It's not useful in case of nested commands (maybe in other cases too);
rely on pg_event_trigger_get_creation_commands().command_tag instead.

contrib/bdr/bdr--0.5.sql

index f5ba5303eecd1aa1943d49f4550e54b89fb949c2..f6554b614eb641b040077ffdbb4cb4327ba0391f 100644 (file)
@@ -211,7 +211,7 @@ BEGIN
                 pg_catalog.pg_event_trigger_expand_command(r.command),
                 'false');
 
-        IF TG_TAG = 'CREATE TABLE' and r.object_type = 'table' THEN
+        IF r.command_tag = 'CREATE TABLE' and r.object_type = 'table' THEN
             EXECUTE 'CREATE TRIGGER truncate_trigger AFTER TRUNCATE ON ' ||
                     r.identity ||
                     ' FOR EACH STATEMENT EXECUTE PROCEDURE bdr.queue_truncate()';