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 1tg4mo-007XFT-3T for pgsql-general@arkaria.postgresql.org; Thu, 06 Feb 2025 16:31:30 +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 1tg4mn-009Ezr-8B for pgsql-general@arkaria.postgresql.org; Thu, 06 Feb 2025 16:31:29 +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 1tg4mm-009Ezd-TE for pgsql-general@lists.postgresql.org; Thu, 06 Feb 2025 16:31:28 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tg4mk-003YrR-2P for pgsql-general@lists.postgresql.org; Thu, 06 Feb 2025 16:31:28 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 4702D13801DD; Thu, 6 Feb 2025 11:31:25 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Thu, 06 Feb 2025 11:31:25 -0500 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=fm2; t=1738859485; x=1738945885; bh=4HY7urAIx1Z4y0qNgCNpItIp5VdO88J+cM6mrIk6JRM=; b= pYNub4+23gSTNhji+V/iOJ+REQFTSo4tPF08iaa0OT2r3u/QqpL/1+97ltyvyZMh ipELNr54HVG6OYVqa4LIozjPnbv7HiNJOb4Fm8CONzviVroA+3/lZe8arwKWKGlr QpS8NBpmdVTCnBuZryeMFU6/HmvIfQH/oO372e28ptNwL/iwkzeVxYSKASNNhfCa HZDT6nkVTeg2W3QMRdD3RNndtPWFvJsH0bZyHWE1ocl374/UDDGPvq1i8Z84gQOP KMEjwFzLwWeF3CyB1BHC0n7g4BPLfyWlJT1DbKfBg5A9OMEYDDsA84HHuNPTm2rR 596P2ls+IVpIK1QE0Ranvg== 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-sender :x-me-sender:x-sasl-enc; s=fm3; t=1738859485; x=1738945885; bh=4 HY7urAIx1Z4y0qNgCNpItIp5VdO88J+cM6mrIk6JRM=; b=pbr5EXoX8WsQu/3L2 CjF7duY2e99r2iIKrRr6j4m/KnRAvB5i1fl/nBW3+3VZu7zRoxbvYBbZBnCTPoMN fCw769YoQwYLagXEgnMKe53f2CE7lOIuNO1I2jRbVBDg65TpD44wsCXXg311RhSS gF9ZQSM48Tya3JCoLCBjtaOPGvn0ivKWXdu6vyN8d3UfeouWDiKMfqNFfspcOuFd DHiFeJoX3EU76YGjoTqqNHwFYIOhg+NIhVVhi9XKHuMqBFH58Bx29WeWw7qt8ZMa cjwIEUW2/cl6hSZHGN3OmPNKA+oQcIEWmNrLpzzMJKbzVVp4NtEiwZL9Gwp7tJvt MpuaA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieekjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrh esrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepiedvhfeiheehgeeuieel jeeitedtjeehudegfeelkedvleekhedtgfeiffefkedunecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghk lhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepphgruhhlrdhfohgvrhhsthgvrhesghhmrghilhdrtghomhdprhgtphht thhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhsrdhpohhsthhgrhgvshhqlhdroh hrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Feb 2025 11:31:24 -0500 (EST) Message-ID: <187f2c5d-f268-4596-bb63-c94790ae761d@aklaver.com> Date: Thu, 6 Feb 2025 08:31:24 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: libc to libicu via pg_dump/pg_restore? To: Paul Foerster , pgsql-general list References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/6/25 01:04, Paul Foerster wrote: > Hi, > Comments inline. > I have a problem which I don't understand. I have and do: > > > instance a, libc based, PostgreSQL 15.10: > > mydb=# \l mydb > List of databases > Name | Owner | Encoding | Collate | Ctype | ICU Locale | Locale Provider | Access privileges > ------+---------+----------+-------------+-------------+------------+-----------------+------------------- > mydb | my_user | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | libc | > > $ pg_dump -Fc -Z1 -b mydb -f mydb.dump.gz > $ ls -l mydb.dump.gz > -rw------- 1 postgres postgres 14660308577 Feb 6 08:45 mydb.dump.gz > > > instance b, libicu based, PostgreSQL 17.2: > $ psql postgres > > # create database mydb; > # \l mydb > List of databases > Name | Owner | Encoding | Locale Provider | Collate | Ctype | Locale | ICU Rules | Access privileges > ------+----------+----------+-----------------+-------------+-------------+--------+-----------+------------------- > mydb | postgres | UTF8 | icu | en_US.UTF-8 | en_US.UTF-8 | en-US | | > > $ pg_restore -cC --if-exists --disable-triggers -d mydb mydb.dump.gz I would start by doing: 1) Log into postgres database and do: a) DROP DATABASE mydb; b) CREATE DATABASE mydb ; 2) pg_restore -d mydb mydb.dump.gz > pg_restore: error: could not execute query: ERROR: insert or update on table "table_1" violates foreign key constraint "..._fk" > DETAIL: Key (dokument_id)=(1000033680) is not present in table "...". Is dokument_id an integer field? > Command was: ALTER TABLE ONLY myschema.table > ADD CONSTRAINT table_fk FOREIGN KEY (dokument_id) REFERENCES myschema.dokument(id); > > > pg_restore: error: could not execute query: ERROR: insert or update on table "table_2" violates foreign key constraint "..._fk" > DETAIL: Key (dokument_id)=(1000033740) is not present in table "dokument". > Command was: ALTER TABLE ONLY vostra2_str.nen_dokument > ADD CONSTRAINT table_fk FOREIGN KEY (dokument_id) REFERENCES myschema.dokument(id); > > > > What am I doing wrong or how can I better achieve that? Any help would be appreciated. In a follow post you said: "Everything works for all databases. Only this one has that problem." Do you mean you made the same libc --> icu change on the other databases with no errors? > > Thanks in advance. > > Paul > -- Adrian Klaver adrian.klaver@aklaver.com