From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Rethink definition of pg_attribute.attcompression.
Date: Thu, 27 May 2021 17:24:41 +0000
Message-ID: <E1lmJkP-00040Z-QB@gemulon.postgresql.org> (raw)
Rethink definition of pg_attribute.attcompression.
Redefine '\0' (InvalidCompressionMethod) as meaning "if we need to
compress, use the current setting of default_toast_compression".
This allows '\0' to be a suitable default choice regardless of
datatype, greatly simplifying code paths that initialize tupledescs
and the like. It seems like a more user-friendly approach as well,
because now the default compression choice doesn't migrate into table
definitions, meaning that changing default_toast_compression is
usually sufficient to flip an installation's behavior; one needn't
tediously issue per-column ALTER SET COMPRESSION commands.
Along the way, fix a few minor bugs and documentation issues
with the per-column-compression feature. Adopt more robust
APIs for SetIndexStorageProperties and GetAttributeCompression.
Bump catversion because typical contents of attcompression will now
be different. We could get away without doing that, but it seems
better to ensure v14 installations all agree on this. (We already
forced initdb for beta2, anyway.)
Discussion: https://postgr.es/m/626613.1621787110@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/e6241d8e030fbd2746b3ea3f44e728224298f35b
Modified Files
--------------
doc/src/sgml/catalogs.sgml | 12 ++-
doc/src/sgml/config.sgml | 15 ++--
doc/src/sgml/func.sgml | 4 +-
doc/src/sgml/ref/alter_table.sgml | 30 +++----
doc/src/sgml/ref/create_table.sgml | 25 +++---
doc/src/sgml/ref/pg_dump.sgml | 4 +-
doc/src/sgml/ref/pg_dumpall.sgml | 6 +-
doc/src/sgml/storage.sgml | 17 ++--
src/backend/access/brin/brin_tuple.c | 5 +-
src/backend/access/common/indextuple.c | 13 +--
src/backend/access/common/toast_internals.c | 6 +-
src/backend/access/common/tupdesc.c | 7 +-
src/backend/access/heap/heapam_handler.c | 12 ++-
src/backend/bootstrap/bootstrap.c | 7 +-
src/backend/catalog/genbki.pl | 4 +-
src/backend/catalog/heap.c | 2 -
src/backend/commands/tablecmds.c | 124 +++++++++++-----------------
src/backend/parser/gram.y | 38 +++++----
src/backend/utils/misc/guc.c | 8 +-
src/bin/pg_dump/pg_backup.h | 2 -
src/bin/pg_dump/pg_backup_archiver.c | 34 +-------
src/bin/pg_dump/pg_dump.c | 107 ++++++------------------
src/bin/psql/describe.c | 10 +--
src/include/access/toast_compression.h | 24 ++----
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_attribute.h | 8 +-
src/test/regress/expected/compression.out | 42 +++++-----
src/test/regress/expected/compression_1.out | 46 +++++------
src/test/regress/sql/compression.sql | 23 +++---
29 files changed, 257 insertions(+), 380 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Rethink definition of pg_attribute.attcompression.
In-Reply-To: <E1lmJkP-00040Z-QB@gemulon.postgresql.org>
References: <E1lmJkP-00040Z-QB@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox