Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xxuti-0002jn-3R for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Dec 2014 09:46:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xxuth-0003il-KV for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Dec 2014 09:46:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xxuth-0003if-0D for pgsql-bugs@postgresql.org; Mon, 08 Dec 2014 09:46:29 +0000 Received: from mimolette.dalibo.net ([212.85.154.222]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xxuta-0002YP-SO for pgsql-bugs@postgresql.org; Mon, 08 Dec 2014 09:46:27 +0000 Received: from dalibo.com (unknown [78.193.115.39]) by mimolette.dalibo.net (Postfix) with ESMTPSA id D607D788772; Mon, 8 Dec 2014 10:46:19 +0100 (CET) From: Ronan Dunklau To: pgsql-bugs Subject: Dumping database creation options and ACLs Date: Mon, 08 Dec 2014 10:45:57 +0100 Message-ID: <5356359.VLpyF4Jg8x@ronan.dunklau.fr> User-Agent: KMail/4.14.3 (Linux/3.17.5-gentoo; KDE/4.14.3; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7670333.v6fS8mOY1d"; micalg="pgp-sha1"; protocol="application/pgp-signature" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --nextPart7670333.v6fS8mOY1d Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" 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=20= pg_dumpall without the globals options. The often recommended pg_dumpal= l -g +=20 individual dumps of the target databases doesn't restore those. Since pg_dump/pg_restore offer the ability to create the database, it s= hould do=20 so with the correct owner, options and database ACLs.=20 There was some discussion about those issues a while ago (see=20 http://www.postgresql.org/message-id/11646.1272814212@sss.pgh.pa.us for= =20 example). As I understand it, the best way to handle that would be to p= ush=20 these modifications in pg_dump, but it is unclear how it should be done= with=20 regards to restoring to a different database. In the meantime, it would be great to add an option to pg_dumpall allow= ing to=20 dump this information. We could add the db creation in the output of=20= pg_dumpall -g, and add a specific --createdb-only option (similar to -= =2Droles- only and --tablespaces-only). Would such a patch be welcome ? =2D-=20 Ronan Dunklau http://dalibo.com - http://dalibo.org --nextPart7670333.v6fS8mOY1d Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABAgAGBQJUhXNVAAoJEHSCNJt9TqXnOqAIAMn+NwG4xLzBrgqu8Q6uYvcw tu/doyvitaHyFzFT0yhZZKvTSmRKLC476wApPXk2tMHFR/4YDXWjBGlGQhQKdgbI ui9+Y5GlyP/ePwQEa0+wQLcmqSAUNLpOC93JuizfPej+VAgpm36AJL/av8kz7eWg LSb6pXgyaSuiphPvgig84FgwOsAUd2Pp4O0uCJQNAxntSHi58FUtLjYkainOrQtO 6AafgRg+YKADgLXmcOE3AgOHH4IqFfPt1Dx0EsdVOLRczonqbNwShkcxmEU+pB20 k4vYHMhHqQfOYwRURez1R2zPqDkOnE5IPU4cX43lEoGGFlwPfKeQxvaX60aAujo= =Mjvg -----END PGP SIGNATURE----- --nextPart7670333.v6fS8mOY1d--