v34-0003-Change-pg_upgrade-s-invocation-of-pg_dump-to-use.patch
text/x-patch
Filename: v34-0003-Change-pg_upgrade-s-invocation-of-pg_dump-to-use.patch
Type: text/x-patch
Part: 1
Message:
Re: Statistics Import and Export
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: format-patch
Series: patch v34-0003
Subject: Change pg_upgrade's invocation of pg_dump to use --no-data
| File | + | − |
|---|---|---|
| src/bin/pg_dump/pg_dump.c | 1 | 12 |
| src/bin/pg_upgrade/dump.c | 1 | 1 |
From 0a648ab51f0cefa8bc74897a24d3310918133d7a Mon Sep 17 00:00:00 2001 From: Corey Huinker <corey.huinker@gmail.com> Date: Wed, 11 Dec 2024 14:28:54 -0500 Subject: [PATCH v34 03/11] Change pg_upgrade's invocation of pg_dump to use --no-data --- src/bin/pg_dump/pg_dump.c | 13 +------------ src/bin/pg_upgrade/dump.c | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index c8a0b4afdf..e626243f3a 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -818,18 +818,7 @@ main(int argc, char **argv) /* set derivative flags */ dopt.dumpData = data_only || (!schema_only && !statistics_only && !dopt.no_data); dopt.dumpSchema = schema_only || (!data_only && !statistics_only); - - if (statistics_only) - /* stats are only thing wanted */ - dopt.dumpStatistics = true; - else if (dopt.no_statistics) - /* stats specifically excluded */ - dopt.dumpStatistics = false; - else if (dopt.binary_upgrade) - /* binary upgrade and not specifically excluded */ - dopt.dumpStatistics = true; - else - dopt.dumpStatistics = (!data_only && !schema_only); + dopt.dumpStatistics = statistics_only || (!data_only && !schema_only && !dopt.no_statistics); /* * --inserts are already implied above if --column-inserts or diff --git a/src/bin/pg_upgrade/dump.c b/src/bin/pg_upgrade/dump.c index 8345f55be8..ef2f14a79b 100644 --- a/src/bin/pg_upgrade/dump.c +++ b/src/bin/pg_upgrade/dump.c @@ -52,7 +52,7 @@ generate_old_dump(void) snprintf(log_file_name, sizeof(log_file_name), DB_DUMP_LOG_FILE_MASK, old_db->db_oid); parallel_exec_prog(log_file_name, NULL, - "\"%s/pg_dump\" %s --schema-only --quote-all-identifiers " + "\"%s/pg_dump\" %s --no-data --quote-all-identifiers " "--binary-upgrade --format=custom %s --no-sync --file=\"%s/%s\" %s", new_cluster.bindir, cluster_conn_opts(&old_cluster), log_opts.verbose ? "--verbose" : "", -- 2.47.1