Re: BUG #2779: Making an inherited table to a view causes could not open relation error in base table - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #2779: Making an inherited table to a view causes could not open relation error in base table
Date
Msg-id 20061124214532.GT28515@alvh.no-ip.org
Whole thread Raw
In response to Re: BUG #2779: Making an inherited table to a view causes could not open relation error in base table  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #2779: Making an inherited table to a view causes could not open relation error in base table
List pgsql-bugs
Tom Lane wrote:
> "Sven Klemm" <sven@c3d2.de> writes:
> > CREATE TABLE base( name TEXT );
> > CREATE TABLE child() INHERITS( base );
>
> > CREATE RULE "_RETURN" AS ON SELECT TO child DO INSTEAD SELECT 'Chunky
> > Bacon'::text AS name;
>
> This is definitely in the category of "don't do that".  It's an
> oversight that DefineQueryRewrite() doesn't check for the case.
>
> Actually, I wonder whether we still need to support conversion of
> tables to views at all.  That was never meant as anything but a
> temporary hack to allow loading pre-7.1 pg_dump scripts.

IIRC I tried it when I was reviewing the updatable views patch, and it
worked.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2779: Making an inherited table to a view causes could not open relation error in base table
Next
From: Tom Lane
Date:
Subject: Re: BUG #2775: Error select