From: Andrus <kobruleht2@hot.ee>
To: Justin <zzzzz.graf@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: How to restore roles without changing postgres password
Date: Wed, 12 Feb 2020 09:31:48 +0200
Message-ID: <4D6B3F5D59EA48A0BF711C8E461D6388@dell2> (raw)
In-Reply-To: <CALL-XeNbJ8w_edXjqTuPL0DJv1OdS7WU4z9hMzo71DfAnwMVWg@mail.gmail.com>
References: <38D406CB287140A49F635258B634E072@dell2>
<CALL-XeNbJ8w_edXjqTuPL0DJv1OdS7WU4z9hMzo71DfAnwMVWg@mail.gmail.com>
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 bringing of >the line which comments it out.
This script creates cluster copy in every night. So this should be done automatically.
I have little experience with Linux.
Can you provide example, how it should it be done using sed or other tool.
There is also second user named dbandmin whose password cannot changed also.
It would be best if CREATE ROLE and ALTER ROLE clauses for postgres and dbadmin users are removed for file.
Or if this is not reasonable, same passwords or different role names can used in both clusters.
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 generates undocumented clause.
Andrus.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: kobruleht2@hot.ee, zzzzz.graf@gmail.com, pgsql-general@postgresql.org
Subject: Re: How to restore roles without changing postgres password
In-Reply-To: <4D6B3F5D59EA48A0BF711C8E461D6388@dell2>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox