Re: libc to libicu via pg_dump/pg_restore?

From: Paul Foerster <paul(dot)foerster(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: libc to libicu via pg_dump/pg_restore?
Date: 2025-02-07 06:32:28
Message-ID: D46171D1-80B9-4E81-BC26-D47319B90CE3@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Adrian,

> On 6 Feb 2025, at 17:31, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>
> 1) Log into postgres database and do:
>
> a) DROP DATABASE mydb;
> b) CREATE DATABASE mydb <options>;
>
> 2) pg_restore -d mydb mydb.dump.gz

With create database <options> being "template template0", this is what my script does. But I need the -cC options for pg_restore to get ACLs back. Leaving out either one of them will not get me the ACLs back.

>> 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?

Yes, it's a bigint.

> 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?

Yes, I have that PostgreSQL 15.10 cluster with locale provider libc with about 40 databases. I initdb'ed a new PostgreSQL 17.2 cluster with icu as locale provider and did a "create database ... template template0" for all about 40 databases. Then I did the mentioned pg_restore for each of them as a parallel background job in the shell.

The whole database cluster is about 1.2 TB in size so I have to find ways to restore as many databases in parallel as possible. However pg_restore only fails on this single database. All others in that database cluster work fine.

Cheers
Paul

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Foerster 2025-02-07 06:35:36 Re: libc to libicu via pg_dump/pg_restore?
Previous Message Adrian Klaver 2025-02-07 03:16:45 Re: Help in vetting Switch from "MD5" to "scram-sha-256" - during DB Upgrade from EC2- PGS - Community Edn ver 13.X to 15.X