pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bo Thorbjørn Jensen <bo@budget123.dk>
Cc: pgsql-general@postgreSQL.org
Cc: Stephen Frost <sfrost@snowman.net>
Subject: Re: missing public on schema public
Date: Tue, 14 Nov 2017 09:57:03 -0500
Message-ID: <16507.1510671423@sss.pgh.pa.us> (raw)
In-Reply-To: <AD7252BEFBCA3846A8D34ABCDA258D080120F025C6@EXMBX05.mailcloud.dk>
References: <AD7252BEFBCA3846A8D34ABCDA258D080120F025C6@EXMBX05.mailcloud.dk>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

=?iso-8859-1?Q?Bo_Thorbj=F8rn_Jensen?= <bo@budget123.dk> writes:
> I have some additional info and a fix.
> Firstly steps to reproduce:

Yeah, I can reproduce this.  I suspect it got broken by Stephen's hacking
around with default ACLs.  A simple example is

$ pg_dump -c -U postgres postgres | grep -i public
DROP SCHEMA public;
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO postgres;
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
COMMENT ON SCHEMA public IS 'standard public schema';
-- Name: public; Type: ACL; Schema: -; Owner: postgres
GRANT ALL ON SCHEMA public TO PUBLIC;

That's fine, but if I shove it through an archive file:

$ pg_dump -f p.dump -Fc -U postgres postgres

$ pg_restore -c p.dump | grep -i public
DROP SCHEMA public;
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO postgres;
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
COMMENT ON SCHEMA public IS 'standard public schema';

This is *REALLY BAD*.  Quite aside from the restore being wrong,
those two sequences should never ever give different results.
Stephen, you put some filtering logic in the wrong place in pg_dump.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (7+ messages)  latest in thread

Message-ID: <16507.1510671423@sss.pgh.pa.us>
Permalink:  ../16507.1510671423@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16507.1510671423@sss.pgh.pa.us

 · 

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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bo@budget123.dk, sfrost@snowman.net
  Subject: Re: missing public on schema public
  In-Reply-To: <16507.1510671423@sss.pgh.pa.us>
  References: <AD7252BEFBCA3846A8D34ABCDA258D080120F025C6@EXMBX05.mailcloud.dk> <16507.1510671423@sss.pgh.pa.us>

* 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