From: Andrus <kobruleht2@hot.ee>
To: Justin <zzzzz.graf@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to restore roles without changing postgres password
Date: Wed, 12 Feb 2020 12:06:56 +0200
Message-ID: <6316D0244B55410388A5E0FC387B006E@dell2> (raw)
In-Reply-To: <CALL-XeM1ruiC+mFgkORtz7u-O1hnjqYB1jMRG6r61RyCoDdckA@mail.gmail.com>
References: <38D406CB287140A49F635258B634E072@dell2>
<11491.1581461180@sss.pgh.pa.us>
<CALL-XeM1ruiC+mFgkORtz7u-O1hnjqYB1jMRG6r61RyCoDdckA@mail.gmail.com>
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 retrieves globals from other cluster using dblink and applies changes to new cluster.
This can be called instead of pq_dumpall and can edited for custom needs.
Editing plpgsql script is easier for postgres users than creating sed script to delete commands from sql file.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: kobruleht2@hot.ee, zzzzz.graf@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: How to restore roles without changing postgres password
In-Reply-To: <6316D0244B55410388A5E0FC387B006E@dell2>
References: <38D406CB287140A49F635258B634E072@dell2> <11491.1581461180@sss.pgh.pa.us> <CALL-XeM1ruiC+mFgkORtz7u-O1hnjqYB1jMRG6r61RyCoDdckA@mail.gmail.com> <6316D0244B55410388A5E0FC387B006E@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