Skip to content

Commit b4507a2

Browse files
committed
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
1 parent 2034bcc commit b4507a2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/bin/pg_dump/t/002_pg_dump.pl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2368,6 +2368,32 @@
23682368
},
23692369
},
23702370
2371+
'Creation of row-level trigger in partitioned table' => {
2372+
create_order => 92,
2373+
create_sql => 'CREATE TRIGGER test_trigger
2374+
AFTER INSERT ON dump_test.measurement
2375+
FOR EACH ROW EXECUTE PROCEDURE dump_test.trigger_func()',
2376+
regexp => qr/^
2377+
\QCREATE TRIGGER test_trigger AFTER INSERT ON dump_test.measurement \E
2378+
\QFOR EACH ROW \E
2379+
\QEXECUTE FUNCTION dump_test.trigger_func();\E
2380+
/xm,
2381+
like => {
2382+
%full_runs, %dump_test_schema_runs, section_post_data => 1,
2383+
},
2384+
unlike => {
2385+
exclude_dump_test_schema => 1,
2386+
},
2387+
},
2388+
2389+
# this shouldn't ever get emitted
2390+
'Creation of row-level trigger in partition' => {
2391+
regexp => qr/^
2392+
\QCREATE TRIGGER test_trigger AFTER INSERT ON dump_test_second_schema.measurement\E
2393+
/xm,
2394+
like => {},
2395+
},
2396+
23712397
'CREATE TABLE test_fourth_table_zero_col' => {
23722398
create_order => 6,
23732399
create_sql => 'CREATE TABLE dump_test.test_fourth_table (

0 commit comments

Comments
 (0)