0

I am migrating data from SQL Server to Postgres. Since Postgres is case-sensitive, I am trying to add case-insensitive COLLATION but it is failing with the below error -

ERROR: could not create locale "en-u-ks-primary": No such file or directory DETAIL: The operating system could not find any locale data for the locale name "en-u-ks-primary". SQL state: 22023

CREATE COLLATION main.case_insensitive_collation (LC_COLLATE = 'en-u-ks-primary',
        LC_CTYPE = 'en-u-ks-primary'
        PROVIDER = icu,
        DETERMINISTIC = False
    );

Checked the version of postgres -

SELECT version();

"PostgreSQL 12.5 on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit"

Any idea on how can I fix this or get this working ?

Thanks in advance,

Neha

1
  • 1
    Seems to be a Debian problem. works fine with red hat Commented Feb 1, 2023 at 9:21

1 Answer 1

0

Your collation definition is wrong. It should be something like

CREATE COLLATION english_ci (
   PROVIDER = icu,
   LOCALE = 'en-u-ks-level2',
   DETERMINISTIC = FALSE
);

Here is an article that has some information about that.

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.