]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Disallow creating an ICU collation if the DB encoding won't support it.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 3 Sep 2021 20:38:55 +0000 (16:38 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 3 Sep 2021 20:39:04 +0000 (16:39 -0400)
commit2cc018ba8f80a5236faf2c58dfcd18fee581dbbc
tree3f050a83d5df145a0a513bbf3af5f4dcb076f88c
parent67c33a114f38edbd66f68d7b2c0cb7b03611ec48
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
src/backend/commands/collationcmds.c