pgsql: Rethink definition of pg_attribute.attcompression. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Rethink definition of pg_attribute.attcompression.
Date
Msg-id E1lmJkP-00040Z-QB@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Fix vpath build in libpq_pipeline test
Next
From: Tom Lane
Date:
Subject: pgsql: Reduce the range of OIDs reserved for genbki.pl.