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