0

I am using cimg/postgres as my database image.

  - image: cimg/postgres:11.12
    environment:
      POSTGRES_HOST_AUTH_METHOD: trust
      POSTGRES_DB: XXXX
      POSTGRES_USER: XXXX

Then I'd like to use icu collation, so I specified in my database.yml

  adapter: postgresql
  ctype: ja-x-icu
  collation: ja-x-icu

I ran ci with this setting, but the error occurs as below;

PG::WrongObjectType: ERROR:  invalid locale name: "ja-x-icu"

I thought that icu collation is available in cimg/postgres becuase --with-icu is written in the Dockerfile, but actually it does not work.
https://github.com/CircleCI-Public/cimg-postgres/blob/main/15.0/Dockerfile#L68

Question:
・How can I use icu collation with cimg/postgres (in my rails application)?

Thank you in advance.

user16012143
  • 139
  • 7

1 Answers1

0

You cannot use ICU collations as database or cluster collations in PostgreSQL versions before v15.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • thanks! then, can I use icu collation with the image `cimg/postgres:15.0`? I still get the same error: `invalid locale name: "ja-x-icu"` when I use it. – user16012143 Dec 19 '22 at 08:02
  • Perhaps PostgreSQL was built without ICU support? Try to create a container with the `C` locale, connect to it and query `pg_collation`. – Laurenz Albe Dec 19 '22 at 08:27
  • thanks! I checked pg_collation by running `SELECT * FROM pg_collation` and ja-x-icu does exist. – user16012143 Dec 19 '22 at 14:13
  • No idea then. Perhaps you should get the exact `initdb` command that is being run and add it to the question. – Laurenz Albe Dec 19 '22 at 17:39