pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Scalia <jayknowsunix@gmail.com>
To: Jerry Sievers <gsievers19@comcast.net>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Trying to change the owner of some tables
Date: Thu, 25 Jun 2015 10:42:15 -0700
Message-ID: <CABzCKRBye3sA8D=r4cXTsOKkj1KMCXZw0vqfC=zobjO2PDOptg@mail.gmail.com> (raw)
In-Reply-To: <86r3ozhew5.fsf@jerry.enova.com>
References: <558B6B19.1050305@gmail.com>
	<20150625030026.GI3289@postgresql.org>
	<86r3ozhew5.fsf@jerry.enova.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Everything has been corrected. The newly reloaded database is behaving much
better. I did manage to get all my permission issues satisfied, although I
have a followup question: For the two roles I wished to delete, I issued a
revoke all privileges on each schema in the DB with a cascade option, but
if I looked at table, relname in pg_class, I would still see that role as
having select, update, and delete for the role's permission. Why wouldn't
those be revoked when doing a revoke all privileges? Did I miss something?

On Thu, Jun 25, 2015 at 10:33 AM, Jerry Sievers <gsievers19@comcast.net>
wrote:

> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
>
> > John Scalia wrote:
> >
> >> Hi all,
> >>
> >> I'm trying to build a new server from a copy of one of our live Dbs,
> and I imported the schema from there and am now trying to get this new
> server setup with the right ownership
> >> and permissions. All the tables are/were owned by user A, and I've
> changed most of them to user B (names changed to protect the innocent,
> etc.,) However, some tables from the
> >> pg_dump I used to grab the schema, do not show up using \d nor can I
> see them in pg_class. I only found them when I tried to drop user A and
> psql complained. They appear to be in a
> >> different schema and I could change them one at a time, but there are
> more than 2200 of these. For the tables I've already changed, I just
> performed an update on pg_class where
> >> relowner = numeric ID of user A to set that to the numeric ID of user B.
> >
> > You could try the REASSIGN OWNED BY command.
> >
> > Doing manual updates of relowner might not be the greatest idea ever; if
> > any of these tables have grants, the representation of the grantor might
> > be borked after that.
>
> And I wonder about dependency records too?
>
> >
> > --
> > Álvaro Herrera                http://www.2ndQuadrant.com/
> > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>
> --
> Jerry Sievers
> Postgres DBA/Development Consulting
> e: postgres.consulting@comcast.net
> p: 312.241.7800
>

view thread (12+ messages)  latest in thread

Message-ID: <CABzCKRBye3sA8D=r4cXTsOKkj1KMCXZw0vqfC=zobjO2PDOptg@mail.gmail.com>
Permalink:  ../CABzCKRBye3sA8D=r4cXTsOKkj1KMCXZw0vqfC=zobjO2PDOptg@mail.gmail.com/
Also on:    postgresql.org/message-id/CABzCKRBye3sA8D=r4cXTsOKkj1KMCXZw0vqfC=zobjO2PDOptg@mail.gmail.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-admin@postgresql.org
  Cc: jayknowsunix@gmail.com, gsievers19@comcast.net, alvherre@2ndquadrant.com
  Subject: Re: Trying to change the owner of some tables
  In-Reply-To: <CABzCKRBye3sA8D=r4cXTsOKkj1KMCXZw0vqfC=zobjO2PDOptg@mail.gmail.com>
  References: <558B6B19.1050305@gmail.com> <20150625030026.GI3289@postgresql.org> <86r3ozhew5.fsf@jerry.enova.com> <CABzCKRBye3sA8D=r4cXTsOKkj1KMCXZw0vqfC=zobjO2PDOptg@mail.gmail.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