pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Change collate and ctype fields to type text
Date: Thu, 27 Jan 2022 08:00:06 +0000
Message-ID: <E1nCzhO-0007tF-HZ@gemulon.postgresql.org> (raw)

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@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/5e756dd6-0e91-d778-96fd-b1bcb06c161a@2ndquadrant.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(-)



Message-ID: <E1nCzhO-0007tF-HZ@gemulon.postgresql.org>
Permalink:  ../E1nCzhO-0007tF-HZ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nCzhO-0007tF-HZ@gemulon.postgresql.org

 · 

reply

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: peter@eisentraut.org
  Subject: Re: pgsql: Change collate and ctype fields to type text
  In-Reply-To: <E1nCzhO-0007tF-HZ@gemulon.postgresql.org>
  References: <E1nCzhO-0007tF-HZ@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