pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jhm713 <jeff.mitchell.mcclelland@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: Inconsistencies restoring public schema ownership from pg_dump
Date: Fri, 31 Aug 2018 12:22:58 -0700 (MST)
Message-ID: <1535743378066-0.post@n3.nabble.com> (raw)
In-Reply-To: <CAC8iE5ibBidOjg=x==byUV7YtXCULJ3P2OWiguH3Qp=feEPSmg@mail.gmail.com>
References: <CAC8iE5ibBidOjg=x==byUV7YtXCULJ3P2OWiguH3Qp=feEPSmg@mail.gmail.com>

I just wanted to echo that this has also caused me problems. We just used
pg_restore and pg_dump to migrate a bunch of databases to a newer version of
postgres. Some of the databases had changed the ownership of the public
schema, and that was lost in the migration.

Maybe changing the owner of the public schema is considered a bad idea, but
our use case is that we (the postgres admins) support a group of developers
that creates many database driven apps. Most of the databases are secured,
but some are public. By letting that group own the public role (they already
own the database and all its other contents), they can decide whether to
grant or revoke permission on the public schema without granting any of them
superuser access.

Basically, what I am suggesting is that, assuming an unmodified public
schema, running these commands
pg_dump -Fc -f test.pg test
pg_restore -s test.pg | grep -i 'alter schema'

should output:
ALTER SCHEMA public OWNER TO postgres;

And of course if the owner had been changed, that would also be reflected.



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html




Message-ID: <1535743378066-0.post@n3.nabble.com>
Permalink:  ../1535743378066-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1535743378066-0.post@n3.nabble.com

 · 

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: jeff.mitchell.mcclelland@gmail.com
  Subject: Re: Inconsistencies restoring public schema ownership from pg_dump
  In-Reply-To: <1535743378066-0.post@n3.nabble.com>
  References: <CAC8iE5ibBidOjg=x==byUV7YtXCULJ3P2OWiguH3Qp=feEPSmg@mail.gmail.com> <1535743378066-0.post@n3.nabble.com>

* 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