Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TE0rS-0003Fl-0E for pgsql-bugs@postgresql.org; Tue, 18 Sep 2012 16:41:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TE0rQ-0006eT-TK for pgsql-bugs@postgresql.org; Tue, 18 Sep 2012 16:41:21 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q8IGfJWh021843; Tue, 18 Sep 2012 12:41:19 -0400 (EDT) From: Tom Lane To: lalbin@fhcrc.org cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7553: Un-executable view definitions in pg_catalog.pg_views in versions 8.3.x-9.2.0 In-reply-to: References: Comments: In-reply-to lalbin@fhcrc.org message dated "Tue, 18 Sep 2012 06:16:03 -0000" Date: Tue, 18 Sep 2012 12:41:18 -0400 Message-ID: <21842.1347986478@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) X-Archive-Number: 201209/196 X-Sequence-Number: 34190 lalbin@fhcrc.org writes: > I have run across a situation where we are changing schema and table names > that a view references. The view is still viewable with a select statement > but if you try and execute the view definition contained within the > pg_catalog.pg_views, then it fails. This appears to be a variant of the what-alias-to-use-after-a-rename problem that we were discussing last winter: http://archives.postgresql.org/message-id/29791.1327718297@sss.pgh.pa.us That thread kinda died off after coming to the conclusion that there isn't a simple, obviously correct solution. The code's current behavior is definitely wrong in the face of renames, but I don't want to change it in a way that just moves the failure cases elsewhere (which is what would happen for any of the proposals made in the thread :-(). regards, tom lane