pgsql: Change collate and ctype fields to type text

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Change collate and ctype fields to type text
Date: 2022-01-27 08:00:06
Message-ID: E1nCzhO-0007tF-HZ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Change collate and ctype fields to type text

This changes the data type of the catalog fields datcollate, datctype,
collcollate, and collctype from name to text. There wasn't ever a
really good reason for them to be of type name; presumably this was
just carried over from when they were fixed-size fields in pg_control,
first into the corresponding pg_database fields, and then to
pg_collation. The values are not identifiers or object names, and we
don't ever look them up that way.

Changing to type text saves space in the typical case, since locale
names are typically only a few bytes long. But it is also possible
that an ICU locale name with several customization options appended
could be longer than 63 bytes, so this also enables that case, which
was previously probably broken.

Reviewed-by: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/5e756dd6-0e91-d778-96fd-b1bcb06c161a(at)2ndquadrant(dot)com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/54637508f87bd5f07fb9406bac6b08240283be3b

Modified Files
--------------
doc/src/sgml/catalogs.sgml | 40 +++++++++++++++++------------------
src/backend/catalog/pg_collation.c | 10 +++------
src/backend/commands/collationcmds.c | 41 ++++++++++++++++++++++++------------
src/backend/commands/dbcommands.c | 21 ++++++++++++------
src/backend/utils/adt/pg_locale.c | 29 ++++++++++++++++---------
src/backend/utils/init/postinit.c | 11 ++++++++--
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_collation.h | 4 ++--
src/include/catalog/pg_database.h | 12 +++++------
src/include/utils/pg_locale.h | 2 ++
10 files changed, 105 insertions(+), 67 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2022-01-27 08:26:12 pgsql: psql: Add tab completion for ALTER COLLATION / REFRESH VERSION
Previous Message Etsuro Fujita 2022-01-27 07:23:27 pgsql: postgres_fdw: Fix handling of a pending asynchronous request in