2

I'm running a PostgreSQL 11.22 database, and I want to create a new collation to support the Czech language, since I don't see it on the collations list when I select from pg_catalog.

Attempt 1 The documentation claims it is possible to create a collation basing it off of libc like so:

CREATE COLLATION czech (provider = libc, locale = 'cs_CZ'); But I got: ERROR: could not create locale "cs_CZ": No such file or directory
DETAIL: The operating system could not find any locale data for the locale name "cs_CZ".

Attempt 2 After that, I tried creating a custom collation, in which I could manually set the Czech language's collation rules, like so:

CREATE COLLATION IF NOT EXISTS czech (provider = icu, locale = 'und', rules = '...');

But I got the error

ERROR: collation attribute "rules" not recognized LINE 2: ...OT EXISTS custom (provider = icu, locale = 'und', rules = '...

Do I have an incorrect version of PostgreSQL? Is that a newer feature, or does something else need to be configured?

1 Answer 1

2

For the first question, you first have to make sure that the C library has a collation with that name for your current encoding. After you create or install new C library collations, you have to import them into PostgreSQL with

SELECT pg_import_system_collations('pg_catalog');

For the second question, the RULES clause does not exist in the unsupported version 11 of PostgreSQL.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.