pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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.

view thread (8+ messages)  latest in thread

Message-ID: <6316D0244B55410388A5E0FC387B006E@dell2>
Permalink:  ../6316D0244B55410388A5E0FC387B006E@dell2/
Also on:    postgresql.org/message-id/6316D0244B55410388A5E0FC387B006E@dell2

 · 

reply

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, tgl@sss.pgh.pa.us, pgsql-general@postgresql.org
  Subject: Re: How to restore roles without changing postgres password
  In-Reply-To: <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