Обсуждение: [PATCH] pg_dumpall options proposal/patch
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
code@remington.io writes: > 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. What's the point of that? > * Likely controversial - add --merge-credentials-file which loads ROLE/PASSWORD combinations from an ini file and addsto dump output if ROLE password not present. Implemented with an external library, inih. If it requires an external library, it's probably DOA, regardless of whether there's a compelling use-case (which you didn't present anyway). regards, tom lane