Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8B1w-0003l7-C3 for pgsql-admin@arkaria.postgresql.org; Thu, 25 Jun 2015 17:33:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Z8B1v-0005pv-8x for pgsql-admin@arkaria.postgresql.org; Thu, 25 Jun 2015 17:33:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z8B1t-0005pN-GW for pgsql-admin@postgresql.org; Thu, 25 Jun 2015 17:33:37 +0000 Received: from resqmta-ch2-06v.sys.comcast.net ([2001:558:fe21:29:69:252:207:38]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z8B1o-00064w-MG for pgsql-admin@postgresql.org; Thu, 25 Jun 2015 17:33:36 +0000 Received: from resomta-ch2-03v.sys.comcast.net ([69.252.207.99]) by resqmta-ch2-06v.sys.comcast.net with comcast id khYe1q00129Cfhx01hZTE2; Thu, 25 Jun 2015 17:33:27 +0000 Received: from jerry.enova.com ([38.98.177.132]) by resomta-ch2-03v.sys.comcast.net with comcast id khZE1q00Q2rmZlA01hZGsV; Thu, 25 Jun 2015 17:33:25 +0000 Received: by jerry.enova.com (Postfix, from userid 1001) id 6DA617401EC; Thu, 25 Jun 2015 12:33:14 -0500 (CDT) From: Jerry Sievers To: Alvaro Herrera Cc: John Scalia , "pgsql-admin\@postgresql.org" Subject: Re: Trying to change the owner of some tables References: <558B6B19.1050305@gmail.com> <20150625030026.GI3289@postgresql.org> Date: Thu, 25 Jun 2015 12:33:14 -0500 In-Reply-To: <20150625030026.GI3289@postgresql.org> (Alvaro Herrera's message of "Thu, 25 Jun 2015 00:00:26 -0300") Message-ID: <86r3ozhew5.fsf@jerry.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1435253607; bh=14EWlaPyfKj2bEuNZJf4P6fOGRQWZklqE4ZPGNxNSfE=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=lYWc88ICIPW157ps/nr+A6cEBlNJaKo4EGGClmGNwZiRics3+xaZ2aZt1ITzUkKZW 6r4NP9KFnLwqcc5JGilnMGOJm92UCDvbDzmCsC65ZoZneg2EtbAg2nyg0Eur7mWRoQ ZubX7DtQjkx/zvPVuUbrO50Ln/gYs8NlSkpCTINPvsJdmnG/McvQeSDD7UFyQXkcRF +G9uGTjewRQS2KZpgCuTQ8psDwMhYBvMEIey2xy3VnuFJgC0qt30Lrsi1BIgUuVx9W 9psTLl3rtJaEoN3lr4UYUKI1M+jgxMM3PzeCVwh/tnncZizq7m4ApmET0dc1wSxsfs DE4DUWORYKzBg== X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Alvaro Herrera 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 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin