Adrian Klaver writes:
> On 2/11/20 11:31 PM, Andrus wrote:
>> Also I dont understand why GRANTED BY clauses appear in file. This looks
>> like noice.
>> GRANT documentation
>> https://www.postgresql.org/docs/current/sql-grant.html
>> does not contain GRANTED BY clause. It looks like pg_dumpall ge
On 2/11/20 11:31 PM, Andrus wrote:
Hi!
Thank you.
>pg_dumpall creates an SQL file which is just a simple text file
>you can then edit sql removing postgres user fromĀ the file
>This can be automated in a script that searches the generated sql file
for the postgres userĀ replacing it with a bl
Hi!
>Not a bad idea, would want to extend this to all the roles on the server not
>just postgres
>I've edited the global dump many times removing/editing table spaces,
>comment old users, etc..
Maybe it is easier to create plpgsql procedure which returns desired script as
text.
Or it r
Hi!
Thank you.
>pg_dumpall creates an SQL file which is just a simple text file
>you can then edit sql removing postgres user from the file
>This can be automated in a script that searches the generated sql file for the
>postgres user replacing it with a blank/empty line or adds -- to the bri
HI Tom
Not a bad idea, would want to extend this to all the roles on the server
not just postgres
I've edited the global dump many times removing/editing table spaces,
comment old users, etc..
On Tue, Feb 11, 2020 at 5:46 PM Tom Lane wrote:
> "Andrus" writes:
> > How to create backup scri
"Andrus" writes:
> How to create backup script which restores all roles and role memberships
> from other server without changing postgres user password.
[ shrug... ] Edit the command(s) you don't want out of the script.
This seems like a mighty random requirement to expect pg_dump to
support o
pg_dumpall creates an SQL file which is just a simple text file
you can then edit sql removing postgres user from the file
This can be automated in a script that searches the generated sql file for
the postgres user replacing it with a blank/empty line or adds -- to the
bringing of the line whi
Hi!
How to create backup script which restores all roles and role memberships
from other server without changing postgres user password.
I tried shell script
PGHOST=example.com
PGUSER=postgres
PGPASSWORD=mypass
export PGHOST PGPASSWORD PGUSER
pg_dumpall --roles-only --file=globals.sql
psql