pg_dump_for_upgrade.patch
application/octet-stream
Filename: pg_dump_for_upgrade.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/bin/pg_dump/pg_dump.c | 0 | 0 |
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
new file mode 100644
index 82330cb..70e2fd4
*** a/src/bin/pg_dump/pg_dump.c
--- b/src/bin/pg_dump/pg_dump.c
*************** extern int optind,
*** 67,72 ****
--- 67,74 ----
opterr;
+ int pg_upgrade=0;
+
typedef struct
{
const char *descr; /* comment for an object */
*************** main(int argc, char **argv)
*** 345,350 ****
--- 347,353 ----
{"inserts", no_argument, &dump_inserts, 1},
{"lock-wait-timeout", required_argument, NULL, 2},
{"no-tablespaces", no_argument, &outputNoTablespaces, 1},
+ {"pg_upgrade", no_argument, &pg_upgrade, 1},
{"quote-all-identifiers", no_argument, "e_all_identifiers, 1},
{"role", required_argument, NULL, 3},
{"section", required_argument, NULL, 5},
*************** main(int argc, char **argv)
*** 608,613 ****
--- 611,617 ----
/*
* Start transaction-snapshot mode transaction to dump consistent data.
*/
+ if (!pg_upgrade) {
ExecuteSqlStatement(fout, "BEGIN");
if (fout->remoteVersion >= 90100)
{
*************** main(int argc, char **argv)
*** 623,628 ****
--- 627,633 ----
else
ExecuteSqlStatement(fout,
"SET TRANSACTION ISOLATION LEVEL SERIALIZABLE");
+ };
/* Select the appropriate subquery to convert user IDs to names */
if (fout->remoteVersion >= 80100)
*************** getTables(Archive *fout, int *numTables)
*** 4349,4354 ****
--- 4354,4360 ----
* NOTE: it'd be kinda nice to lock other relations too, not only
* plain tables, but the backend doesn't presently allow that.
*/
+ if (!pg_upgrade) {
if (tblinfo[i].dobj.dump && tblinfo[i].relkind == RELKIND_RELATION)
{
resetPQExpBuffer(query);
*************** getTables(Archive *fout, int *numTables)
*** 4359,4364 ****
--- 4365,4371 ----
tblinfo[i].dobj.name));
ExecuteSqlStatement(fout, query->data);
}
+ };
/* Emit notice if join for owner failed */
if (strlen(tblinfo[i].rolname) == 0)