Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit de75281

Browse files
committed
pg_dump: Fix dumping of publications
Dumping a publication with more than one table crashed pg_dump. patch by Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, test by me
1 parent 6ec4c85 commit de75281

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/bin/pg_dump/pg_dump.c

+1
Original file line numberDiff line numberDiff line change
@@ -3557,6 +3557,7 @@ getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
35573557
pubrinfo[j].dobj.catId.oid = atooid(PQgetvalue(res, j, i_oid));
35583558
AssignDumpId(&pubrinfo[j].dobj);
35593559
pubrinfo[j].dobj.namespace = tbinfo->dobj.namespace;
3560+
pubrinfo[j].dobj.name = tbinfo->dobj.name;
35603561
pubrinfo[j].pubname = pg_strdup(PQgetvalue(res, j, i_pubname));
35613562
pubrinfo[j].pubtable = tbinfo;
35623563
}

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

+28
Original file line numberDiff line numberDiff line change
@@ -2286,6 +2286,34 @@
22862286
exclude_test_table => 1,
22872287
pg_dumpall_globals => 1,
22882288
pg_dumpall_globals_clean => 1, }, },
2289+
'ALTER PUBLICATION pub1 ADD TABLE test_second_table' => {
2290+
create_order => 52,
2291+
create_sql =>
2292+
'ALTER PUBLICATION pub1 ADD TABLE dump_test.test_second_table;',
2293+
regexp => qr/^
2294+
\QALTER PUBLICATION pub1 ADD TABLE test_second_table;\E
2295+
/xm,
2296+
like => {
2297+
binary_upgrade => 1,
2298+
clean => 1,
2299+
clean_if_exists => 1,
2300+
createdb => 1,
2301+
defaults => 1,
2302+
exclude_test_table => 1,
2303+
exclude_test_table_data => 1,
2304+
no_privs => 1,
2305+
no_owner => 1,
2306+
only_dump_test_schema => 1,
2307+
pg_dumpall_dbprivs => 1,
2308+
schema_only => 1,
2309+
section_post_data => 1,
2310+
test_schema_plus_blobs => 1, },
2311+
unlike => {
2312+
section_pre_data => 1,
2313+
exclude_dump_test_schema => 1,
2314+
only_dump_test_table => 1,
2315+
pg_dumpall_globals => 1,
2316+
pg_dumpall_globals_clean => 1, }, },
22892317
22902318
'CREATE SCHEMA dump_test' => {
22912319
all_runs => 1,

0 commit comments

Comments
 (0)