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

From Tom Lane
Subject Re: BUG #2779: Making an inherited table to a view causes could not open relation error in base table
Date
Msg-id 26912.1164404241@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2779: Making an inherited table to a view causes could not open relation error in base table  ("Sven Klemm" <sven@c3d2.de>)
Responses Re: BUG #2779: Making an inherited table to a view causes could not open relation error in base table
List pgsql-bugs
"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.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Дейтер Александр Валериевич
Date:
Subject: PostgreSQL 8.1.5: regression tests fail on sparc
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #2779: Making an inherited table to a view causes could not open relation error in base table