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 1tfxog-006ZNS-TH for pgsql-general@arkaria.postgresql.org; Thu, 06 Feb 2025 09:04:59 +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 1tfxof-005YWK-SV for pgsql-general@arkaria.postgresql.org; Thu, 06 Feb 2025 09:04:57 +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 1tfxof-005YW7-H7 for pgsql-general@lists.postgresql.org; Thu, 06 Feb 2025 09:04:57 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tfxoc-003q6N-2L for pgsql-general@lists.postgresql.org; Thu, 06 Feb 2025 09:04:57 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-436341f575fso6639285e9.1 for ; Thu, 06 Feb 2025 01:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738832693; x=1739437493; darn=lists.postgresql.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=S41ccwezXz5PPq1mbPhnFHSZsZPKLWsZs7UhGehWHZ0=; b=nC683gDFS1eMbxKriFxXosxwHjXyMmq8IpyubHCcE9eb5IgDV8QOJxT+B2I8+3xtMk 2cFwtYedvz+pCQf1V0ZBisZd7V6NTWxvG7hmZoeS90BgigrwOIN/35xFBu4XQHzVASUZ g5VkHEeqfRt6eEDmgp4/PKizNBIHxEJ8JhWo/CxcEuDI0pSZvQs651cfxTGcopxfWbRk J41us/wmF10I1csaSRmWQwOz3hR3kK0zbnws3Hbch9Ga16CNMCF6cIK3IvdoPpDzi6nu cUBha0X6zCa9lEEUKNQKswhILQOMJStWmZcVu2S7UUk89ybNYemBIqJTYnyAzigKTSEr p7pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738832693; x=1739437493; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S41ccwezXz5PPq1mbPhnFHSZsZPKLWsZs7UhGehWHZ0=; b=SDN3ijSTYxgRDaeSgx01V/8hGEMpwFs43/qy/9DLQLz+zsDGeaO3W9WVfpV+YxdrK2 p8p+3acTxS/iWc7diA74J7NJDqdgewpmvi6mBPqED1J4srvsra0d0fIjNXdjgy1D5UQx ScYNXHPxUqXFxsZOW+R56j55N+LKFMinVv2k9e+BM3BzcGUaWi67aCVdPfNPFQdjMsvT ObPF+cRw6TBggF+eyg305ouFudTh8FbqXKLjwvEqjnXP4tOCkv8a0krgrVMzMFSmgMfH qTXykpHSFr5ytnDABQbb5C4MpfGtTBqsUaxsvQuBOVlI0SofFbefZ5SH9wiGxu/HVgDu 5tKw== X-Gm-Message-State: AOJu0YxecAdX6K+1vEyRp1NlKYPGmWdIXHI3EiZXPx9i2H2VdjnWGIfJ stjoNOoixLv/j6gygQykFyc0f8nLm58zBrMBpwTOZc/liYyWk7CfRQGKsw== X-Gm-Gg: ASbGncvk/pMX0z6qbChjMSrSkgIdqbADuV0hK/zwdN079t73Q9EDTAV1gYKapzIn6Pb 2FhlDbhgbOBbco3kLtUDRXSYSDLmb7/ngmDdib0kriSC38+5A93QyhFyMhvIGIX5YWM+p+q+k3b se+7HbIOBmMjCohb2RT//OWz1gvv80Uhbx90Ot6dh389rSnJketvkufT0uyhQWDM0Ubg8eVQUSt hpYgv9sdcb8h1p+heFpak+NjYviY2OKeVWufR7TJku6tV+lLAGJDggUQw5PPSGeCOryEMTKoQr3 POh4O+tRttK6r9xZ2pLxp2e+PzDU8nu2eR7oWzeT3m8vPzoHdS9MZ1BXNwvgnGkDbQj7 X-Google-Smtp-Source: AGHT+IFXF79/PoArd9m/1J/ErgMjyJo8vIOAkm+gkPj+yihrTtUwcmuJT7pm4PN118895T0l1Iumcw== X-Received: by 2002:a05:600c:1554:b0:434:a04d:1670 with SMTP id 5b1f17b1804b1-4390d34b92emr59365185e9.0.1738832692921; Thu, 06 Feb 2025 01:04:52 -0800 (PST) Received: from smtpclient.apple (143-45-239-77.dyn.cable.qlnet.ch. [77.239.45.143]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4390d9334e7sm48002825e9.6.2025.02.06.01.04.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Feb 2025 01:04:52 -0800 (PST) From: Paul Foerster Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: libc to libicu via pg_dump/pg_restore? Message-Id: Date: Thu, 6 Feb 2025 10:04:21 +0100 To: pgsql-general list X-Mailer: Apple Mail (2.3826.400.131.1.6) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, I have a problem which I don't understand. I have and do: instance a, libc based, PostgreSQL 15.10: mydb=3D# \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 pg_restore: error: could not execute query: ERROR: cannot drop the = currently open database Command was: DROP DATABASE IF EXISTS mydb; pg_restore: error: could not execute query: ERROR: database "mydb" = already exists Command was: CREATE DATABASE mydb WITH TEMPLATE =3D template0 ENCODING =3D= 'UTF8' LOCALE_PROVIDER =3D libc LOCALE =3D 'en_US.UTF-8'; pg_restore: error: could not execute query: ERROR: insert or update on = table "table_1" violates foreign key constraint "..._fk" DETAIL: Key (dokument_id)=3D(1000033680) is not present in table "...". 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)=3D(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); I'm sorry, I sort of had to anonymize object names. But you should be = able to get the gist of it. It's a dreaded message when importing. My = goal is to export libc PostgreSQL 15 databases and import them into = PostgreSQL 17 as libicu based databases to get away from glibc based = sorting. I searched the net to find the "--disable-triggers" disable = triggers when running pg_restore but the errors still occur. What am I doing wrong or how can I better achieve that? Any help would = be appreciated. Thanks in advance. Paul=