Re: Running psql in a docker container

From: felix(dot)quintgz(at)yahoo(dot)com
To: PostgreSQL Users Mailing List <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Running psql in a docker container
Date: 2024-07-12 13:52:29
Message-ID: 1718220334.4150807.1720792349258@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In the docker-compose.yml file it can be passed in the environment variables.

POSTGRES_INITDB_ARGS: "--encoding=UTF-8"

On Thursday, July 11, 2024 at 10:58:14 AM GMT-4, H <agents(at)meddatainc(dot)com> wrote:

I used to successfully run psql server 13 in a CentOS 7 docker container with CentOS 7 as the host operating system. I have now upgraded that system to Rocky Linux 9 as the host operating system and modifying my container to also use Rocky Linux 9 and psql server 16.

I can successfully get the container up and running and can connect to it. However, I have not managed to modify the initdb statement to use en_US.UTF-8 for all databases.

In the old container I used:

su - postgres -c "/usr/pgsql-13/bin/initdb -D /var/lib/pgsql/13/data/ -E 'UTF-8' --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'"

but this does not work with psql 16. I tried:

su - postgres -c "/usr/pgsql-16/bin/initdb -D /var/lib/pgsql/16/data/ -E 'UTF-8' --lc-lang='en_US'"

and variations thereof with no success.

Any suggestions on what I have missed?

Thank you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mukesh Tanuku 2024-07-12 15:11:03 Replication lag in Postgres
Previous Message pradeep t 2024-07-12 13:18:33 Semantic cache capability for Postgresql db