aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2014-12-30 17:41:46 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2014-12-30 17:41:46 -0300
commit72dd233d3ef12da0f041bb3024deaa6d2950369c (patch)
treee6865fba84be1b87b9e69e24ec142e5132578d03 /src/test
parenta676201490c8113b4692562126c77a29dfd8dac1 (diff)
downloadpostgresql-72dd233d3ef12da0f041bb3024deaa6d2950369c.tar.gz
postgresql-72dd233d3ef12da0f041bb3024deaa6d2950369c.zip
pg_event_trigger_dropped_objects: Add name/args output columns
These columns can be passed to pg_get_object_address() and used to reconstruct the dropped objects identities in a remote server containing similar objects, so that the drop can be replicated. Reviewed by Stephen Frost, Heikki Linnakangas, Abhijit Menon-Sen, Andres Freund.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/event_trigger.out25
-rw-r--r--src/test/regress/sql/event_trigger.sql5
2 files changed, 16 insertions, 14 deletions
diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
index 72e1660d6b9..869d713f5b7 100644
--- a/src/test/regress/expected/event_trigger.out
+++ b/src/test/regress/expected/event_trigger.out
@@ -305,8 +305,9 @@ BEGIN
IF NOT r.normal AND NOT r.original THEN
CONTINUE;
END IF;
- RAISE NOTICE 'NORMAL: orig=% normal=% type=% identity=%',
- r.original, r.normal, r.object_type, r.object_identity;
+ RAISE NOTICE 'NORMAL: orig=% normal=% type=% identity=% name=% args=%',
+ r.original, r.normal, r.object_type, r.object_identity,
+ r.address_names, r.address_args;
END LOOP;
END; $$;
CREATE EVENT TRIGGER regress_event_trigger_report_dropped ON sql_drop
@@ -316,23 +317,23 @@ CREATE SCHEMA evttrig
CREATE INDEX one_idx ON one (col_b)
CREATE TABLE two (col_c INTEGER CHECK (col_c > 0) REFERENCES one DEFAULT 42);
ALTER TABLE evttrig.two DROP COLUMN col_c;
-NOTICE: NORMAL: orig=t normal=f type=table column identity=evttrig.two.col_c
-NOTICE: NORMAL: orig=f normal=t type=table constraint identity=two_col_c_check on evttrig.two
+NOTICE: NORMAL: orig=t normal=f type=table column identity=evttrig.two.col_c name={evttrig,two,col_c} args={}
+NOTICE: NORMAL: orig=f normal=t type=table constraint identity=two_col_c_check on evttrig.two name={evttrig,two,two_col_c_check} args={}
ALTER TABLE evttrig.one ALTER COLUMN col_b DROP DEFAULT;
-NOTICE: NORMAL: orig=t normal=f type=default value identity=for evttrig.one.col_b
+NOTICE: NORMAL: orig=t normal=f type=default value identity=for evttrig.one.col_b name={evttrig,one,col_b} args={}
ALTER TABLE evttrig.one DROP CONSTRAINT one_pkey;
-NOTICE: NORMAL: orig=t normal=f type=table constraint identity=one_pkey on evttrig.one
+NOTICE: NORMAL: orig=t normal=f type=table constraint identity=one_pkey on evttrig.one name={evttrig,one,one_pkey} args={}
DROP INDEX evttrig.one_idx;
-NOTICE: NORMAL: orig=t normal=f type=index identity=evttrig.one_idx
+NOTICE: NORMAL: orig=t normal=f type=index identity=evttrig.one_idx name={evttrig,one_idx} args={}
DROP SCHEMA evttrig CASCADE;
NOTICE: drop cascades to 2 other objects
DETAIL: drop cascades to table evttrig.one
drop cascades to table evttrig.two
-NOTICE: NORMAL: orig=t normal=f type=schema identity=evttrig
-NOTICE: NORMAL: orig=f normal=t type=table identity=evttrig.one
-NOTICE: NORMAL: orig=f normal=t type=sequence identity=evttrig.one_col_a_seq
-NOTICE: NORMAL: orig=f normal=t type=default value identity=for evttrig.one.col_a
-NOTICE: NORMAL: orig=f normal=t type=table identity=evttrig.two
+NOTICE: NORMAL: orig=t normal=f type=schema identity=evttrig name={evttrig} args={}
+NOTICE: NORMAL: orig=f normal=t type=table identity=evttrig.one name={evttrig,one} args={}
+NOTICE: NORMAL: orig=f normal=t type=sequence identity=evttrig.one_col_a_seq name={evttrig,one_col_a_seq} args={}
+NOTICE: NORMAL: orig=f normal=t type=default value identity=for evttrig.one.col_a name={evttrig,one,col_a} args={}
+NOTICE: NORMAL: orig=f normal=t type=table identity=evttrig.two name={evttrig,two} args={}
DROP EVENT TRIGGER regress_event_trigger_report_dropped;
-- only allowed from within an event trigger function, should fail
select pg_event_trigger_table_rewrite_oid();
diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql
index 7987fde50b9..b2c89315fcd 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -218,8 +218,9 @@ BEGIN
IF NOT r.normal AND NOT r.original THEN
CONTINUE;
END IF;
- RAISE NOTICE 'NORMAL: orig=% normal=% type=% identity=%',
- r.original, r.normal, r.object_type, r.object_identity;
+ RAISE NOTICE 'NORMAL: orig=% normal=% type=% identity=% name=% args=%',
+ r.original, r.normal, r.object_type, r.object_identity,
+ r.address_names, r.address_args;
END LOOP;
END; $$;
CREATE EVENT TRIGGER regress_event_trigger_report_dropped ON sql_drop