Skip to content

Commit 419a23b

Browse files
committed
pg_dump: Emit ONLY before table added to publication
This is necessary to be able to reproduce publication membership correctly if tables are involved in inheritance. Author: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
1 parent 1fe3325 commit 419a23b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3627,7 +3627,7 @@ dumpPublicationTable(Archive *fout, PublicationRelInfo *pubrinfo)
36273627

36283628
query = createPQExpBuffer();
36293629

3630-
appendPQExpBuffer(query, "ALTER PUBLICATION %s ADD TABLE",
3630+
appendPQExpBuffer(query, "ALTER PUBLICATION %s ADD TABLE ONLY",
36313631
fmtId(pubrinfo->pubname));
36323632
appendPQExpBuffer(query, " %s;",
36333633
fmtId(tbinfo->dobj.name));

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4423,7 +4423,7 @@
44234423
create_sql =>
44244424
'ALTER PUBLICATION pub1 ADD TABLE dump_test.test_table;',
44254425
regexp => qr/^
4426-
\QALTER PUBLICATION pub1 ADD TABLE test_table;\E
4426+
\QALTER PUBLICATION pub1 ADD TABLE ONLY test_table;\E
44274427
/xm,
44284428
like => {
44294429
binary_upgrade => 1,
@@ -4457,7 +4457,7 @@
44574457
create_sql =>
44584458
'ALTER PUBLICATION pub1 ADD TABLE dump_test.test_second_table;',
44594459
regexp => qr/^
4460-
\QALTER PUBLICATION pub1 ADD TABLE test_second_table;\E
4460+
\QALTER PUBLICATION pub1 ADD TABLE ONLY test_second_table;\E
44614461
/xm,
44624462
like => {
44634463
binary_upgrade => 1,

0 commit comments

Comments
 (0)