summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Davis2025-07-16 16:57:12 +0000
committerJeff Davis2025-07-16 16:57:12 +0000
commit48c2c7b4b45b3bb696d566f4f425fccdd871532f (patch)
tree675c0db8074113953a8eb7950bdb0ea0dac08efb
parentecc5161a0bd3cba8dda7ece98e0848856b97b7a1 (diff)
pg_dumpall: Skip global objects with --statistics-only or --no-schema.
Previously, pg_dumpall would still dump global objects such as roles and tablespaces even when --statistics-only or --no-schema was specified. Since these global objects are treated as schema-level data, they should be skipped in these cases. This commit fixes the issue by ensuring that global objects are not dumped when either --statistics-only or --no-schema is used. Author: Fujii Masao <[email protected]> Reviewed-by: Corey Huinker <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: 18
-rw-r--r--src/bin/pg_dump/pg_dumpall.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 3cbcad65c5..100317b1aa 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -632,7 +632,7 @@ main(int argc, char *argv[])
fprintf(OPF, "SET escape_string_warning = off;\n");
fprintf(OPF, "\n");
- if (!data_only)
+ if (!data_only && !statistics_only && !no_schema)
{
/*
* If asked to --clean, do that first. We can avoid detailed