[PATCH] pg_dumpall options proposal/patch

From: code(at)remington(dot)io
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] pg_dumpall options proposal/patch
Date: 2020-12-04 20:57:03
Message-ID: 195a5a76d10e23162620fa8f1ff43a1d@remington.io
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hi pgsql-hackers,

I have a relatively trivial proposal - this affects pg_dumpall exclusively. Primary use case in ability to use pg_dumpall without 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 to dump 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-12-04 21:02:12 Re: [PATCH] Add support for leading/trailing bytea trim()ing
Previous Message Justin Pryzby 2020-12-04 19:54:15 Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly