Skip to content

Commit 694da19

Browse files
committed
Add --no-toast-compression to pg_dumpall
This is an oversight from bbe0a81, where the equivalent option exists in pg_dump. This is useful to be able to reset the compression methods cluster-wide when restoring the data based on default_toast_compression. Reviewed-by: Daniel Gustafsson, Tom Lane Discussion: https://postgr.es/m/YKHC+qCJvzCRVCpY@paquier.xyz
1 parent 2e7c178 commit 694da19

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

doc/src/sgml/ref/pg_dumpall.sgml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,18 @@ PostgreSQL documentation
458458
</listitem>
459459
</varlistentry>
460460

461+
<varlistentry>
462+
<term><option>--no-toast-compression</option></term>
463+
<listitem>
464+
<para>
465+
Do not output commands to set <acronym>TOAST</acronym> compression
466+
methods.
467+
With this option, all objects will be created using whichever
468+
compression method is the default during restore.
469+
</para>
470+
</listitem>
471+
</varlistentry>
472+
461473
<varlistentry>
462474
<term><option>--no-unlogged-table-data</option></term>
463475
<listitem>

src/bin/pg_dump/pg_dumpall.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ static int no_comments = 0;
7777
static int no_publications = 0;
7878
static int no_security_labels = 0;
7979
static int no_subscriptions = 0;
80+
static int no_toast_compression = 0;
8081
static int no_unlogged_table_data = 0;
8182
static int no_role_passwords = 0;
8283
static int server_version;
@@ -144,6 +145,7 @@ main(int argc, char *argv[])
144145
{"no-security-labels", no_argument, &no_security_labels, 1},
145146
{"no-subscriptions", no_argument, &no_subscriptions, 1},
146147
{"no-sync", no_argument, NULL, 4},
148+
{"no-toast-compression", no_argument, &no_toast_compression, 1},
147149
{"no-unlogged-table-data", no_argument, &no_unlogged_table_data, 1},
148150
{"on-conflict-do-nothing", no_argument, &on_conflict_do_nothing, 1},
149151
{"rows-per-insert", required_argument, NULL, 7},
@@ -428,6 +430,8 @@ main(int argc, char *argv[])
428430
appendPQExpBufferStr(pgdumpopts, " --no-security-labels");
429431
if (no_subscriptions)
430432
appendPQExpBufferStr(pgdumpopts, " --no-subscriptions");
433+
if (no_toast_compression)
434+
appendPQExpBufferStr(pgdumpopts, " --no-toast-compression");
431435
if (no_unlogged_table_data)
432436
appendPQExpBufferStr(pgdumpopts, " --no-unlogged-table-data");
433437
if (on_conflict_do_nothing)
@@ -651,6 +655,7 @@ help(void)
651655
printf(_(" --no-subscriptions do not dump subscriptions\n"));
652656
printf(_(" --no-sync do not wait for changes to be written safely to disk\n"));
653657
printf(_(" --no-tablespaces do not dump tablespace assignments\n"));
658+
printf(_(" --no-toast-compression do not dump TOAST compression methods\n"));
654659
printf(_(" --no-unlogged-table-data do not dump unlogged table data\n"));
655660
printf(_(" --on-conflict-do-nothing add ON CONFLICT DO NOTHING to INSERT commands\n"));
656661
printf(_(" --quote-all-identifiers quote all identifiers, even if not key words\n"));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy