pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ronan Dunklau <ronan.dunklau@dalibo.com>
To: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Dumping database creation options and ACLs
Date: Mon, 08 Dec 2014 10:45:57 +0100
Message-ID: <5356359.VLpyF4Jg8x@ronan.dunklau.fr> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Hello.

Not sure if I should file this on pgsql-bugs or pgsql-hackers...

As of now, the only way to restore database options and ACLs is to use 
pg_dumpall without the globals options. The often recommended pg_dumpall -g + 
individual dumps of the target databases doesn't restore those.

Since pg_dump/pg_restore offer the ability to create the database, it should do 
so with the correct owner, options and database ACLs. 

There was some discussion about those issues a while ago (see 
http://www.postgresql.org/message-id/11646.1272814212@sss.pgh.pa.us for 
example). As I understand it, the best way to handle that would be to push 
these modifications in pg_dump, but it is unclear how it should be done with 
regards to restoring to a different database.

In the meantime, it would be great to add an option to pg_dumpall allowing to 
dump this information. We could add the db creation in the output of 
pg_dumpall -g,  and add a specific --createdb-only option (similar to --roles-
only and --tablespaces-only).

Would such a patch be welcome ?


-- 
Ronan Dunklau
http://dalibo.com - http://dalibo.org

Attachments:

  signature.asc (application/pgp-signature, 472B) download

view thread (2+ messages)  latest in thread

Message-ID: <5356359.VLpyF4Jg8x@ronan.dunklau.fr>
Permalink:  ../5356359.VLpyF4Jg8x@ronan.dunklau.fr/
Also on:    postgresql.org/message-id/5356359.VLpyF4Jg8x@ronan.dunklau.fr

 · 

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 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-bugs@postgresql.org
  Cc: ronan.dunklau@dalibo.com
  Subject: Re: Dumping database creation options and ACLs
  In-Reply-To: <5356359.VLpyF4Jg8x@ronan.dunklau.fr>
  References: <5356359.VLpyF4Jg8x@ronan.dunklau.fr>

* 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