Re: libc to libicu via pg_dump/pg_restore? - Mailing list pgsql-general

From Paul Foerster
Subject Re: libc to libicu via pg_dump/pg_restore?
Date
Msg-id 5A9148A0-CF9C-4841-A9C0-D7E299AC4ADD@gmail.com
Whole thread Raw
In response to Re: libc to libicu via pg_dump/pg_restore?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: libc to libicu via pg_dump/pg_restore?
List pgsql-general
Hi Adrian,

sorry for the late answer. I'm just too busy.

> On 7 Feb 2025, at 17:19, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>
>> With create database <options> being "template template0", this is what my script does. But I need the -cC options
forpg_restore to get ACLs back. Leaving out either one of them will not get me the ACLs back. 
>
> That does not make sense.
>
> Are there ACLs(privileges) in the database at all?
>
> What is the pg_dump command you are running?

I use this pg_dump command:

pg_dump -Fc -Z1 --quote-all-identifiers -b "${PGDATABASE}" -f ${dumpBase}/${clusterName}.${PGDATABASE}.dump.gz
>${PGDATABASE}.out2>${PGDATABASE}.err & 

The command is embedded in a Bash script for loop that loops PGDATABASE over all database names inside the cluster and
launchespg_dump as a background job. It then waits for all jobs to complete ("wait" command). dumpBase is just the
destinationdirectory. 

If I don't use -cC, i.e. both, then the Access privileges will not be restored. Checking with \l just shows an empty
fieldas usual for a newly created database. This happens at least with 17.2. I didn't check that with 17.3 yet. 

I agree, from how I understood the docs I should be able to only use -C and not -c.

As for the data inconsistency, PostgreSQL is right. I found out that some clever person did a "alter table … disable
triggerall" on a table and then manipulated data. That broke referential integrity. So, this case is closed. 

Cheers,
Paul


pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: Re: Best Approach for Swapping a Table with its Copy
Next
From: Adrian Klaver
Date:
Subject: Re: libc to libicu via pg_dump/pg_restore?