Re: Running psql in a docker container

From: H <agents(at)meddatainc(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org,Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>,PostgreSQL Users Mailing List <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Running psql in a docker container
Date: 2024-07-11 18:14:55
Message-ID: FE769B77-E004-43AE-A9D0-DCAA8A22E757@meddatainc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On July 11, 2024 11:06:02 AM GMT-04:00, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>On 7/11/24 07:57, H 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.
>
>Without a definition of what '... no success' means there is no real
>way
>to answer this.
>
>>
>> Any suggestions on what I have missed?
>>
>> Thank you.
>>
>>

Good question! ”No success” meant that I have not been able to figure out how to have new databases default to en_US.UTF-8, instead they default to C.UTF-8.

What is the proper syntax for pgsql 16 for this? I could not get the example given in the docs to work...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2024-07-11 18:20:43 Re: Running psql in a docker container
Previous Message Gus Spier 2024-07-11 17:21:39 page is not marked all-visible but visibility map bit is set in relation "pg_statistic"