Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 1 addition & 36 deletions src/bin/pg_dump/pg_backup_archiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -4935,43 +4935,8 @@ CloneArchive(ArchiveHandle *AH)

/* re-establish fixed state */
if (AH->mode == archModeRead)
{
Assert(AH->connection == NULL);

/* this also sets clone->connection */
ConnectDatabase((Archive *) clone, &clone->public.ropt->cparams, true, false);

/* re-establish fixed state */
_doSetFixedOutputState(clone);
}
else
{
PQExpBufferData connstr;
char *pghost;
char *pgport;
char *username;

Assert(AH->connection != NULL);

/*
* Even though we are technically accessing the parent's database
* object here, these functions are fine to be called like that
* because all just return a pointer and do not actually send/receive
* any data to/from the database.
*/
initPQExpBuffer(&connstr);
appendPQExpBufferStr(&connstr, "dbname=");
appendConnStrVal(&connstr, PQdb(AH->connection));
pghost = PQhost(AH->connection);
pgport = PQport(AH->connection);
username = PQuser(AH->connection);

/* this also sets clone->connection */
ConnectDatabase((Archive *) clone, &clone->public.ropt->cparams, true, false);

termPQExpBuffer(&connstr);
/* setupDumpWorker will fix up connection state */
}
/* in write case, setupDumpWorker will fix up connection state */

/* Let the format-specific code have a chance too */
clone->ClonePtr(clone);
Expand Down
16 changes: 9 additions & 7 deletions src/bin/pg_dump/t/002_pg_dump.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2214,20 +2214,22 @@
create_order => 19,
create_sql => 'CREATE TABLE dump_test.test_table_ao(a integer, b text)
WITH (appendonly = true, compresstype = zlib, compresslevel = 1);',
regexp => qr/^
\QCREATE TABLE dump_test.test_table_ao (\E\n
\s+\Qa integer,\E\n
\s+\Qb text\E\n
\QWITH (appendonly = true, orientation = column, compresstype = zlib, compresslevel = 1);\E\n/xm,
regexp => qr{^
\QCREATE TABLE dump_test.test_table_ao (\E
\n\s+\Qa integer,\E
\n\s+\Qb text\E
\n\Q)\E
\n\QWITH (appendonly = true, compresstype=zlib, compresslevel='1');\E
}xm,
like => {
%full_runs,
%dump_test_schema_runs,
only_dump_test_table => 1,
section_pre_data => 1,
exclude_test_table => 1,
},
unlike => {
only_dump_test_table => 1,
exclude_dump_test_schema => 1,
exclude_test_table => 1,
},
},

Expand Down
Loading