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 1sRzW9-002vKk-Vg for pgsql-general@arkaria.postgresql.org; Thu, 11 Jul 2024 19:31:50 +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 1sRzW7-00HVew-1c for pgsql-general@arkaria.postgresql.org; Thu, 11 Jul 2024 19:31:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRzW5-00HVeo-Dg for pgsql-general@lists.postgresql.org; Thu, 11 Jul 2024 19:31:46 +0000 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRzW1-001aBP-Rq for pgsql-general@lists.postgresql.org; Thu, 11 Jul 2024 19:31:43 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 22C761380478; Thu, 11 Jul 2024 15:31:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 11 Jul 2024 15:31:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1720726300; x=1720812700; bh=R6dNT+MHl0lYXFDKziQIOZC5zcT/e218ePlWtMmUKaA=; b= MLe25rHvWrWXJ8qKF9gtP0LVBLW82T6+FgmPg+bhbNeitCsnqi/uGVuDHITR8aQK 1XfZrSJ2/JHuJHUF4k0ykI59HKEtENwuoWGOhZACRWtSxssTt09GS0RuY7okQWJ/ JDP8nIQwA6BG2uMzvS6LBUJuwyo+fB69yHquTuGjvhAsYgjQPBxfN9bnLP7rtpQg V5d3TdYuNdJ/1WnPC2DnUhzxSEDRBatGKfA2kvLgB8D857Mgixa5CMQFSqyCXg3C nexGfI7C1MKEgLs3Gvg0b/gH2yktBUtM18bOAJ+JeAKFRQ9/Xx9x7Fo4a3QZWS+e i2joZVqeWxhDm0M6kMShbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1720726300; x= 1720812700; bh=R6dNT+MHl0lYXFDKziQIOZC5zcT/e218ePlWtMmUKaA=; b=K iaEDLYKb7ZYsz4QlWp+vPkaqtgMVahCZHuBuz3aZbwZD6COTSKoJzrrSzQA2xjbq RCsRsD4WBqBxlROAwKkrUI/+sOKR/MAJmAGkrl46twSL26StiEuDZLBKwTE6eNYq ufK6PduEU7JOskqN4SDZ7JX96HXuvq1f85MzGwzKL959TRXoXrLPH9nDHqM5SsIl qNnoYwKeSrU+W0vcsQM0BN/vyxA+I5QPkUxLxXrLFJd2Iis/LUR2zoSDvzirUG4f bAGRVijooWGoE2yeH93hzm0x48ZoE97Zi/YCZ6YGQ+zs/+gy/88kDzTh8cO7mUsH zuMQTZnKkOo2Oy3dj9nsA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrfeeggddufeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepleegveekke ekueeigfdtveeileeuhfefudefteekjeffkeejueejheegheegkedtnecuffhomhgrihhn pehpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgt ohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Jul 2024 15:31:38 -0400 (EDT) Message-ID: <1b395ea3-6577-416a-b3d5-c384da7cf226@aklaver.com> Date: Thu, 11 Jul 2024 12:31:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Running psql in a docker container To: H , pgsql-general@lists.postgresql.org References: <21E2962B-6905-462C-8C12-6E9454CD26FC@meddatainc.com> <97d1dbfd-6e7b-4019-828f-489ccd6e7eae@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. 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'" 1) Per: https://www.postgresql.org/docs/16/app-initdb.html lc_lang does not exist and I get: /usr/lib/postgresql/16/bin/initdb: unrecognized option '--lc-lang=en_US' 2) On Ubuntu 22.04 doing: /usr/lib/postgresql/16/bin/initdb -D postgres/16/data/ -E 'UTF-8' --lc-collate='en_US.utf8' --lc-ctype='en_US.utf8' I get: postgres=# \l List of databases -[ RECORD 1 ]-----+-------------------- Name | postgres Owner | aklaver Encoding | UTF8 Locale Provider | libc Collate | en_US.utf8 Ctype | en_US.utf8 ICU Locale | ICU Rules | Access privileges | -[ RECORD 2 ]-----+-------------------- Name | template0 Owner | aklaver Encoding | UTF8 Locale Provider | libc Collate | en_US.utf8 Ctype | en_US.utf8 ICU Locale | ICU Rules | Access privileges | =c/aklaver + | aklaver=CTc/aklaver -[ RECORD 3 ]-----+-------------------- Name | template1 Owner | aklaver Encoding | UTF8 Locale Provider | libc Collate | en_US.utf8 Ctype | en_US.utf8 ICU Locale | ICU Rules | Access privileges | =c/aklaver + | aklaver=CTc/aklaver 3) What does locale -a return on your machine? >>> >>> 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... -- Adrian Klaver adrian.klaver@aklaver.com