Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z7xRx-0006kV-2c for pgsql-admin@arkaria.postgresql.org; Thu, 25 Jun 2015 03:03:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Z7xRw-0007Ik-Bn for pgsql-admin@arkaria.postgresql.org; Thu, 25 Jun 2015 03:03:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z7xP6-0004C7-FD for pgsql-admin@postgresql.org; Thu, 25 Jun 2015 03:00:40 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z7xP1-0000H1-Rp for pgsql-admin@postgresql.org; Thu, 25 Jun 2015 03:00:39 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [186.37.122.40]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id DFB05400CAB; Wed, 24 Jun 2015 20:00:28 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 705BD1201; Thu, 25 Jun 2015 00:00:26 -0300 (CLT) Date: Thu, 25 Jun 2015 00:00:26 -0300 From: Alvaro Herrera To: John Scalia Cc: "pgsql-admin@postgresql.org" Subject: Re: Trying to change the owner of some tables Message-ID: <20150625030026.GI3289@postgresql.org> References: <558B6B19.1050305@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <558B6B19.1050305@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) 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 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. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin