[PATCH] pg_dumpall options proposal/patch - Mailing list pgsql-hackers

From code@remington.io
Subject [PATCH] pg_dumpall options proposal/patch
Date
Msg-id 195a5a76d10e23162620fa8f1ff43a1d@remington.io
Whole thread Raw
Responses Re: [PATCH] pg_dumpall options proposal/patch
List pgsql-hackers
Hi pgsql-hackers,

I have a relatively trivial proposal - this affects pg_dumpall exclusively. Primary use case in ability to use
pg_dumpallwithout SUPERUSER. 

* Add --no-alter-role flag to only use CREATE ROLE syntax instead of CREATE then ALTER.
* Add --exclude-role flag similar to --exclude-database, semantically equivalent but applying to ROLEs.
* Add --no-granted-by flag to explicitly omit GRANTED BY clauses.
* Likely controversial - add --merge-credentials-file which loads ROLE/PASSWORD combinations from an ini file and adds
todump output if ROLE password not present. Implemented with an external library, inih. 

All together, based against REL_12_STABLE:
https://github.com/remingtonc/postgres/compare/REL_12_STABLE...remingtonc:REL_12_STABLE_DUMPALL_CLOUDSQL

Example usage used against GCP Cloud SQL:
pg_dumpall --host=$HOST --username=$USER --no-password \
    --no-role-passwords --merge-credentials-file=$CREDENTIALS_PATH \
    --quote-all-identifiers --no-comments --no-alter-role --no-granted-by \
    --exclude-database=postgres\* --exclude-database=template\* --exclude-database=cloudsql\* \
    --exclude-role=cloudsql\* --exclude-role=postgres\* \
    --file=$DUMP_PATH

Before I go to base against master and split in to individual patches - does this seem reasonable?

Best,
Remington



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Add docs stub for recovery.conf
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Add support for leading/trailing bytea trim()ing