Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zjs6T-0003by-Ta for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Oct 2015 17:02:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zjs6R-0007x9-HE for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Oct 2015 17:02:07 +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 1Zjs6Q-0007wU-G0 for pgsql-bugs@postgresql.org; Wed, 07 Oct 2015 17:02:06 +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 1Zjs6M-0005eB-U6 for pgsql-bugs@postgresql.org; Wed, 07 Oct 2015 17:02:05 +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 [200.104.52.149]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 5AAE7400FA4; Wed, 7 Oct 2015 10:01:57 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id ACED810C3; Wed, 7 Oct 2015 14:01:54 -0300 (CLT) Date: Wed, 7 Oct 2015 14:01:54 -0300 From: Alvaro Herrera To: cpacejo@clearskydata.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13666: REASSIGN OWNED BY doesn't affect the relation underlying composite type Message-ID: <20151007170154.GB4405@alvherre.pgsql> References: <20151007142530.8425.57690@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20151007142530.8425.57690@wrigleys.postgresql.org> 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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org cpacejo@clearskydata.com wrote: > =# CREATE TYPE foo AS (a integer, b integer); > > =# ALTER TYPE foo OWNER TO user1; > > =# SELECT typowner, relowner FROM pg_type JOIN pg_class ON typrelid = > relfilenode WHERE typname = 'foo'; > -[ RECORD 1 ]--- > typowner | 16384 > relowner | 16384 > > =# REASSIGN OWNED BY user1 TO user2; > > =# SELECT typowner, relowner FROM pg_type JOIN pg_class ON typrelid = > relfilenode WHERE typname = 'foo'; > -[ RECORD 1 ]--- > typowner | 8713825 > relowner | 16384 Hmm. I guess we're missing a recursion step somewhere. I would have assumed that the pg_class entry would also have a dependency on the owner and should would have been visited in the initial loop. Strange. > Furthermore, while trying to replicate in another database, I encountered: > > =# REASSIGN OWNED BY user1 TO user2; > ERROR: unexpected classid 1418 > > Not sure if this is related or not. Not related. 1418 is pg_user_mapping (FDW stuff). Not sure what should happen here; my inclination without thinking too hard is that REASSIGN OWNED should ignore that object and DROP OWNED should remove it. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs