aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2019-12-27 18:34:30 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2019-12-27 18:34:30 -0300
commit0a40f33b8768f065692aeda5b84eb1ec91aa03f0 (patch)
tree9535f2cc60121a0c36286c7412ba8a84a5bc4795
parente6cf1724d8cdf81b4ec7e613e1b41357834261f9 (diff)
downloadpostgresql-0a40f33b8768f065692aeda5b84eb1ec91aa03f0.tar.gz
postgresql-0a40f33b8768f065692aeda5b84eb1ec91aa03f0.zip
Add pg_dump test for triggers on partitioned tables
This currently works, but add this test to ensure it continues to work. Lack of this test became evident after a recent bugfix submission that would have inadvertently broken it, in https://postgr.es/m/CA+HiwqFM2=i+uHB9o4OkLbE2S3sjPHoVe2wXuAD1GLJ4+Pk9eg@mail.gmail.com
-rw-r--r--src/bin/pg_dump/t/002_pg_dump.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl
index 9d3c178c332..577c6e5316d 100644
--- a/src/bin/pg_dump/t/002_pg_dump.pl
+++ b/src/bin/pg_dump/t/002_pg_dump.pl
@@ -2370,6 +2370,32 @@ my %tests = (
},
},
+ 'Creation of row-level trigger in partitioned table' => {
+ create_order => 92,
+ create_sql => 'CREATE TRIGGER test_trigger
+ AFTER INSERT ON dump_test.measurement
+ FOR EACH ROW EXECUTE PROCEDURE dump_test.trigger_func()',
+ regexp => qr/^
+ \QCREATE TRIGGER test_trigger AFTER INSERT ON dump_test.measurement \E
+ \QFOR EACH ROW \E
+ \QEXECUTE PROCEDURE dump_test.trigger_func();\E
+ /xm,
+ like => {
+ %full_runs, %dump_test_schema_runs, section_post_data => 1,
+ },
+ unlike => {
+ exclude_dump_test_schema => 1,
+ },
+ },
+
+ # this shouldn't ever get emitted
+ 'Creation of row-level trigger in partition' => {
+ regexp => qr/^
+ \QCREATE TRIGGER test_trigger AFTER INSERT ON dump_test_second_schema.measurement\E
+ /xm,
+ like => {},
+ },
+
'CREATE TABLE test_fourth_table_zero_col' => {
create_order => 6,
create_sql => 'CREATE TABLE dump_test.test_fourth_table (