pgsql: Disallow creating an ICU collation if the DB encoding won't supp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Disallow creating an ICU collation if the DB encoding won't supp
Date: 2021-09-03 20:39:59
Message-ID: E1mMFyh-0001K4-6K@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Disallow creating an ICU collation if the DB encoding won't support it.

Previously this was allowed, but the collation effectively vanished
into the ether because of the way lookup_collation() works: you could
not use the collation, nor even drop it. Seems better to give an
error up front than to leave the user wondering why it doesn't work.

(Because this test is in DefineCollation not CreateCollation, it does
not prevent pg_import_system_collations from creating ICU collations,
regardless of the initially-chosen encoding.)

Per bug #17170 from Andrew Bille. Back-patch to v10 where ICU support
was added.

Discussion: https://postgr.es/m/17170-95845cf3f0a9c36d@postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5d7c6b6c8b4a9e03a16b5c2f5106e1fc5bff9681

Modified Files
--------------
src/backend/commands/collationcmds.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-09-03 20:42:58 Re: pgsql: Set the volatility of the timestamptz version of date_bin() back
Previous Message Justin Pryzby 2021-09-03 18:27:25 Re: pgsql: Set the volatility of the timestamptz version of date_bin() back