M
M
Max Payne2019-06-20 15:04:01
PostgreSQL
Max Payne, 2019-06-20 15:04:01

How to change docker postgresql encoding?

Postgres service added to docker-compose:

postgres:
    image: postgres:11.3-alpine
...
    environment:
      - LANG:'ja_JP.UTF-8'
      - LANGUAGE:'ja_JP.UTF-8'
      - LC_ALL:'ja_JP.UTF-8'

there was a need to use the Japanese locale due to the fact that the databases would store data from Japanese sites, all hieroglyphs, and so on, however, the standard en_US.UTF-8 locale did not display some characters. By adding environment variables, in theory, postgresql should create a standard database (postgres) in ja_JP encoding, but this does not happen.
In general, I need the EUC_JP encoding, which expands ASCII, but for some reason I don’t set the encoding in principle :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-06-20
@YardalGedal

You are setting the environment incorrectly. Fix like this:

environment:
      - LANG=ja_JP.eucJP
      - LANGUAGE=ja_JP.eucJP
      - LC_ALL=ja_JP.eucJP
      - POSTGRES_INITDB_ARGS='-E EUC_JP'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question