Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sS0Pe-0034Pq-Ax for pgsql-general@arkaria.postgresql.org; Thu, 11 Jul 2024 20:29:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sS0Pd-000PBB-27 for pgsql-general@arkaria.postgresql.org; Thu, 11 Jul 2024 20:29:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sS0Pc-000PB1-Ni for pgsql-general@lists.postgresql.org; Thu, 11 Jul 2024 20:29:08 +0000 Received: from mout.perfora.net ([74.208.4.194]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sS0PZ-001cAk-UC for pgsql-general@lists.postgresql.org; Thu, 11 Jul 2024 20:29:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meddatainc.com; s=s1-ionos; t=1720729742; x=1721334542; i=agents@meddatainc.com; bh=03fC+KHn6ebUu/eVSspFu9hJL6+seELBDq3ZNnQbVBc=; h=X-UI-Sender-Class:Date:In-Reply-To:References:MIME-Version: Content-Type:Content-Transfer-Encoding:Subject:To:From:Message-ID: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=T6VHKYylGR6Jjthf9lcMmg4WRJuu6J8q6sosGj5DhqJzq9r/XiDdlB5Nrowcbe2h QrkmJ/a9rZvS7j/Kd4EqBa8N8Snd41B1TPXK1S3mUcuQ8NDL7PCCWT4jt3V+QYYdh Z9gijMCymnJVurmBbWkL4wmzjp7CcKlFLLwTGaZlbeMmVVBKQN7Rkbe7BcuaAhleq 8HrOQMNhc+lbFYFZp4cDwX9ZZP3wDdKOUcgYfMIsToBmwZP7ZZCX6utVwEMRrpHMc wfRRRlYPvLHXoCYBOIuD457Hhi7jciZgYAa4CPnBB2LRLyx4nhSLf6TsXtUbfjjyH XmKQzf7N0n/o7/yVLg== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from [192.168.105.230] ([96.245.190.98]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MVNfs-1srqtv3fva-00Jfpg; Thu, 11 Jul 2024 22:29:02 +0200 Date: Thu, 11 Jul 2024 16:28:35 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <1b395ea3-6577-416a-b3d5-c384da7cf226@aklaver.com> References: <21E2962B-6905-462C-8C12-6E9454CD26FC@meddatainc.com> <97d1dbfd-6e7b-4019-828f-489ccd6e7eae@aklaver.com> <1b395ea3-6577-416a-b3d5-c384da7cf226@aklaver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Running psql in a docker container To: pgsql-general@lists.postgresql.org,Adrian Klaver From: H Message-ID: <6D486324-937D-4894-957D-074DBDCEFEFF@meddatainc.com> X-Provags-ID: V03:K1:K0DRsv+tzUJTIugySlqk6yf30wPjhSNNvU9UrK+H+H89R2A74U3 lWGcbcZKWU1qjDkSzPObnChkVXI73YLr+S8WJXi936rdnlp1F7hWyphhLf1QnXtmj4tswW7 Q0SUhh1dWQ5M9JDHEdd1bMVUu/5s3AAE7fYM9DEDznhaorLfgVdmv9gH4b4+ooi3HCGQpTf gusSpNdysI8Tqo636tPww== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:m2LhN9p6Wto=;2CUQChQDD+c1e+jl2cn1D2WsyDx qUvllKvH+h2+Tr3el1kXIizwoiqX/Koq3vdwDI0LQrQER9VcaMR0XKnNBf231CtvWBHanGKTF DxEgGK8sQy0ud7aYnsqlXd5TfxCovxX2a/SHh0p9YLD3L0G1/17OENImPZ0d/0enCESmdruvJ HbGFJghPUl/nHBc7HybJ/3Ir9qT+fr2XSRgRamLlEqaQ8QQTyoq9hyKs6ZrA1XdoargtxNvgK Wy7jxybtJUNcYOQ1lEkRE7G0StHEnQfqoiAZFCG3auvtJtTzAfJqC1NALmF9/GmVbnrU+6k3a tbG6MVH5IlioTPA7UATB+cmP6h/QMZW7s9E1MADH9cujy4MRZ1qJpD7bK7W3HgvWYanmzhwlu 9UCpuGcsAHnwkWqWVOPqcn5u52PKePYt0GKMO9szkg86fJEgYynvhuVx5NSI2qtls6XN084Rv EdwTp7R3UZCOla81JgD36jdwaA6uIns6lfTRiYg3InWp5o85KreDemUOLjLD6n2qRIYaUlZiz puhjx2v9w0fEn6bEbswzUia9nfT2ORwCh0y/DLmBGysEg9DQ4GnXMFWixuB6+cs/bLa3EnXyS /EeFmS1bPha44FZo9nvDf5HLcEzMmrYolMDW0poGF6mUkjtaONfwKIObF9u1PSOtV869SgPlF DSPejLlcjh2jJ1nUdgx4rRjygff0Et6MmDVnZtguROm46z4AKoiXxpaFC62umR3JD+LTQrutU E8E++RPYF5qwygUiG2HscTWmF96cAyQew== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On July 11, 2024 3:31:37 PM EDT, Adrian Klaver wrote: >On 7/11/24 11:14, H wrote: >> On July 11, 2024 11:06:02 AM GMT-04:00, Adrian Klaver > 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=2E 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=2E >>>> >>>> I can successfully get the container up and running and can connect >>> to it=2E However, I have not managed to modify the initdb statement to >>> use en_US=2EUTF-8 for all databases=2E >>>> >>>> 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=3D'en_US=2EUTF-8' --lc-ctype=3D'en_US=2EUTF-8'= " >>>> >>>> but this does not work with psql 16=2E I tried: >>>> >>>> su - postgres -c "/usr/pgsql-16/bin/initdb -D >/var/lib/pgsql/16/data/ >>> -E 'UTF-8' --lc-lang=3D'en_US'" > >1) Per: > >https://www=2Epostgresql=2Eorg/docs/16/app-initdb=2Ehtml > >lc_lang does not exist and I get: > >/usr/lib/postgresql/16/bin/initdb: unrecognized option >'--lc-lang=3Den_US' > >2) On Ubuntu 22=2E04 doing: > > /usr/lib/postgresql/16/bin/initdb -D postgres/16/data/ -E 'UTF-8'=20 >--lc-collate=3D'en_US=2Eutf8' --lc-ctype=3D'en_US=2Eutf8' > >I get: > >postgres=3D# \l >List of databases >-[ RECORD 1 ]-----+-------------------- >Name | postgres >Owner | aklaver >Encoding | UTF8 >Locale Provider | libc >Collate | en_US=2Eutf8 >Ctype | en_US=2Eutf8 >ICU Locale | >ICU Rules | >Access privileges | >-[ RECORD 2 ]-----+-------------------- >Name | template0 >Owner | aklaver >Encoding | UTF8 >Locale Provider | libc >Collate | en_US=2Eutf8 >Ctype | en_US=2Eutf8 >ICU Locale | >ICU Rules | >Access privileges | =3Dc/aklaver + > | aklaver=3DCTc/aklaver >-[ RECORD 3 ]-----+-------------------- >Name | template1 >Owner | aklaver >Encoding | UTF8 >Locale Provider | libc >Collate | en_US=2Eutf8 >Ctype | en_US=2Eutf8 >ICU Locale | >ICU Rules | >Access privileges | =3Dc/aklaver + > | aklaver=3DCTc/aklaver > >3) What does locale -a return on your machine? > > >>>> >>>> and variations thereof with no success=2E >>> >>> Without a definition of what '=2E=2E=2E no success' means there is no = real >>> way >>> to answer this=2E >>> >>>> >>>> Any suggestions on what I have missed? >>>> >>>> Thank you=2E >>>> >>>> >>=20 >> Good question! =E2=80=9DNo success=E2=80=9D meant that I have not been = able to figure >out how to have new databases default to en_US=2EUTF-8, instead they >default to C=2EUTF-8=2E >>=20 >> What is the proper syntax for pgsql 16 for this? I could not get the >example given in the docs to work=2E=2E=2E You are right, the locale is now called en_US=2Eutf8 and with that correct= ion I get the expected result=2E