From: Peter Eisentraut Date: Mon, 17 Apr 2017 13:47:39 +0000 (-0400) Subject: pg_dump: Emit ONLY before table added to publication X-Git-Tag: REL_10_BETA1~245 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=419a23b478ae760b797188341ddce5b41322684b;p=thirdparty%2Fpostgresql.git 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 --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 3eccfa626bf..22b5f784dc0 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -3627,7 +3627,7 @@ dumpPublicationTable(Archive *fout, PublicationRelInfo *pubrinfo) query = createPQExpBuffer(); - appendPQExpBuffer(query, "ALTER PUBLICATION %s ADD TABLE", + appendPQExpBuffer(query, "ALTER PUBLICATION %s ADD TABLE ONLY", fmtId(pubrinfo->pubname)); appendPQExpBuffer(query, " %s;", fmtId(tbinfo->dobj.name)); diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl index 4dd208e8e11..ccd0ed6a539 100644 --- a/src/bin/pg_dump/t/002_pg_dump.pl +++ b/src/bin/pg_dump/t/002_pg_dump.pl @@ -4423,7 +4423,7 @@ qr/CREATE TRANSFORM FOR integer LANGUAGE sql \(FROM SQL WITH FUNCTION pg_catalog create_sql => 'ALTER PUBLICATION pub1 ADD TABLE dump_test.test_table;', regexp => qr/^ - \QALTER PUBLICATION pub1 ADD TABLE test_table;\E + \QALTER PUBLICATION pub1 ADD TABLE ONLY test_table;\E /xm, like => { binary_upgrade => 1, @@ -4457,7 +4457,7 @@ qr/CREATE TRANSFORM FOR integer LANGUAGE sql \(FROM SQL WITH FUNCTION pg_catalog create_sql => 'ALTER PUBLICATION pub1 ADD TABLE dump_test.test_second_table;', regexp => qr/^ - \QALTER PUBLICATION pub1 ADD TABLE test_second_table;\E + \QALTER PUBLICATION pub1 ADD TABLE ONLY test_second_table;\E /xm, like => { binary_upgrade => 1,