Create an explicit concept of collations that work for any encoding.
Tom Lane <tgl@sss.pgh.pa.us>
Create an explicit concept of collations that work for any encoding. Use collencoding = -1 to represent such a collation in pg_collation. We need this to make the "default" entry work sanely, and a later patch will fix the C/POSIX entries to be represented this way instead of duplicating them across all encodings. All lookup operations now search first for an entry that's database-encoding-specific, and then for the same name with collencoding = -1. Also some incidental code cleanup in collationcmds.c and pg_collation.c.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/catalogs.sgml | modified | +7 −5 |
| src/backend/catalog/information_schema.sql | modified | +3 −3 |
| src/backend/catalog/namespace.c | modified | +35 −13 |
| src/backend/catalog/pg_collation.c | modified | +41 −26 |
| src/backend/commands/collationcmds.c | modified | +59 −24 |
| src/bin/psql/tab-complete.c | modified | +1 −1 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_collation.h | modified | +5 −5 |
| src/test/regress/expected/collate.linux.utf8.out | modified | +6 −6 |