pgsql: Fix up pg_dump's handling of per-attribute compression options.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix up pg_dump's handling of per-attribute compression options.
Date: 2021-03-20 19:01:17
Message-ID: E1lNgqb-0005kI-2p@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix up pg_dump's handling of per-attribute compression options.

The approach used in commit bbe0a81db would've been disastrous for
portability of dumps. Instead handle non-default compression options
in separate ALTER TABLE commands. This reduces chatter for the
common case where most columns are compressed the same way, and it
makes it possible to restore the dump to a server that lacks any
knowledge of per-attribute compression options (so long as you're
willing to ignore syntax errors from the ALTER TABLE commands).

There's a whole lot left to do to mop up after bbe0a81db, but
I'm fast-tracking this part because we need to see if it's
enough to make the buildfarm's cross-version-upgrade tests happy.

Justin Pryzby and Tom Lane

Discussion: https://postgr.es/m/20210119190720.GL8560@telsasoft.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/aa25d1089ac00bbc3f97d2efe8f54c3d4beed5d1

Modified Files
--------------
src/bin/pg_dump/pg_backup.h | 4 +-
src/bin/pg_dump/pg_backup_archiver.c | 34 ++++++++-
src/bin/pg_dump/pg_dump.c | 133 ++++++++++++++++++++++++-----------
src/bin/pg_dump/pg_dump.h | 2 +-
src/bin/pg_dump/t/002_pg_dump.pl | 12 ++--
5 files changed, 134 insertions(+), 51 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tomas Vondra 2021-03-20 23:29:17 pgsql: Use valid compression method in brin_form_tuple
Previous Message Tom Lane 2021-03-20 16:48:07 pgsql: Fix memory leak when rejecting bogus DH parameters.