From: mage@mage.li
To: pgsql-bugs@postgresql.org
Subject: BUG #12843: pg_dump -O inserts four unwanted lines to the end of the dump
Date: Mon, 09 Mar 2015 09:12:42 +0000
Message-ID: <20150309091242.2544.58018@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 12843
Logged by: Péter Mózes Merl
Email address: mage@mage.li
PostgreSQL version: 9.3.0
Operating system: Any
Description:
It affects many versions.
The manual says about -O:
"To make a script that can be restored by any user, but will give that user
ownership of all the objects, specify -O."
This actually does not work because there are four lines inserted at the end
of the dump:
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
The problem is that the source and the target system might have different
users. Usually they do when we deploy Rails.
Not to forget that Linux distributions have different default user than the
one created in FreeBSD (postgres vs pgsql).
To load the dump by another user these four lines have to be removed. Which
is painful when the dump is large. It is needed more often than not.
I suggest simply not inserting them when -O is set.
Thank you.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: mage@mage.li
Subject: Re: BUG #12843: pg_dump -O inserts four unwanted lines to the end of the dump
In-Reply-To: <20150309091242.2544.58018@wrigleys.postgresql.org>
References: <20150309091242.2544.58018@wrigleys.postgresql.org>
* 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