Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z7y3R-0007wn-Rv for pgsql-admin@arkaria.postgresql.org; Thu, 25 Jun 2015 03:42:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Z7y3R-0003D9-CT for pgsql-admin@arkaria.postgresql.org; Thu, 25 Jun 2015 03:42:21 +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 1Z7y3Q-0003Cr-6Z for pgsql-admin@postgresql.org; Thu, 25 Jun 2015 03:42:20 +0000 Received: from mail-ig0-x22b.google.com ([2607:f8b0:4001:c05::22b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z7y3N-000132-5i for pgsql-admin@postgresql.org; Thu, 25 Jun 2015 03:42:18 +0000 Received: by igbiq7 with SMTP id iq7so110763497igb.1 for ; Wed, 24 Jun 2015 20:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=GUvAXup2s2z6n67zi0Nux3bolRvCrNaAvomVVkvJbsQ=; b=U/ccOCO8tMG0se2DbWBzCto0XcSmv+BR0fdj4sZtCiMpQN3wCvM1/8kluMs2/+625F 1rvSgB9CJVEvT4tOemzw50xDdzocxSs67d7+2mSNfEJnCImQLqlMX1dUsC2Tg/NMDttO n5+3jIg2RrSJ1Se+KJtPp+wUu3lipmhkne7NC51tip3J5R+duA0i0LH9vIfx4iBVoZDm mdaxhd3hLpNz3G4Cl6q9WdxF7Yn1QNClfe1MXxdXCbR9fgl5PaPNspbCc4Ba4eU2YFEH 0iI9HYb4fmxHUYr0Hng7LJE5GOTMMJo13pYnoCoOBhjOl6rbumzedqTgAy45JeIED51x 8pVQ== X-Received: by 10.50.117.35 with SMTP id kb3mr1328287igb.13.1435203736384; Wed, 24 Jun 2015 20:42:16 -0700 (PDT) Received: from ?IPv6:2600:100f:b11b:760b:6cee:3971:c522:90fc? ([2600:100f:b11b:760b:6cee:3971:c522:90fc]) by mx.google.com with ESMTPSA id lr1sm2517106igb.10.2015.06.24.20.42.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2015 20:42:15 -0700 (PDT) Message-ID: <558B7893.5000407@gmail.com> Date: Wed, 24 Jun 2015 20:42:11 -0700 From: John Scalia User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "David G. Johnston" CC: "pgsql-admin@postgresql.org" Subject: Re: Trying to change the owner of some tables References: <558B6B19.1050305@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------090606030409050803060806" X-Pg-Spam-Score: -2.7 (--) 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 This is a multi-part message in MIME format. --------------090606030409050803060806 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thanks guys, I was not aware of that command, but it did NOT succeed in c= hanging these strangely missing tables. The tables appear, when I try to = drop the old owner as: second_schema.partition_table_name_one; then two, three, etc., I've only been successful using alter table second_schema.partition_table_name_one owner to userB; But I'd rather not do that for 2000+ entries. On 6/24/2015 8:01 PM, David G. Johnston wrote: > On Wed, Jun 24, 2015 at 10:44 PM, 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, et= c.,) 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 a= re more than 2200 of these. For the tables I've already changed, I just p= erformed an update on pg_class where > relowner =3D numeric ID of user A to set that to the numeric ID of = user B. > > Now, this is a 9.2 server on CentOS, but I've not seen this behavio= r anywhere before. Where else should I see these? The only success I've h= ad is \d+ new_schema.* and that > doesn't > help me change them. > > > =E2=80=8B Possibly this... > > http://www.postgresql.org/docs/9.4/static/sql-reassign-owned.html > =E2=80=8B > David J. --------------090606030409050803060806 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Thanks guys, I was not aware of that command, but it did NOT succeed in changing these strangely missing tables. The tables appear, when I try to drop the old owner as:

second_schema.partition_table_name_one;

then two, three, etc.,  I've only been successful using

alter table second_schema.partition_table_name_one owner to userB;

But I'd rather not do that for 2000+ entries.

On 6/24/2015 8:01 PM, David G. Johnston wrote:
On Wed, Jun 24, 2015 at 10:44 PM, John Scalia <jayknowsunix@gmail.com> 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.

Now, this is a 9.2 server on CentOS, but I've not seen this behavior anywhere before. Where else should I see these? The only success I've had is \d+ new_schema.* and that doesn't
help me change them.

​ Possibly this...

​
David J.

--------------090606030409050803060806--