Re: Why does an ON SELECT rule have to be named "_RETURN"? - Mailing list pgsql-general

From Tom Lane
Subject Re: Why does an ON SELECT rule have to be named "_RETURN"?
Date
Msg-id 25704.1139787791@sss.pgh.pa.us
Whole thread Raw
In response to Why does an ON SELECT rule have to be named "_RETURN"?  ("Ken Winter" <ken@sunward.org>)
Responses Re: Why does an ON SELECT rule have to be named "_RETURN"?  ("Ken Winter" <ken@sunward.org>)
List pgsql-general
"Ken Winter" <ken@sunward.org> writes:
> * Why this constraint?
> * Would anything break if I were allowed to get away with my little trick?
> * Is there any way to get around the constraint?

The reason why the table is converted to a view is that ancient pg_dump
dumps used to create views in exactly that way (make a table and then
add an ON SELECT rule) and so when we started making a hard distinction
between tables and views, we needed to force the conversion to occur.

The notion of a real table that has an ON SELECT rule seems fairly
broken to me in any case.  I think you should be complaining to the
authors of your client-side tools that they won't do what you want.
It would probably be quite a trivial change to get them to support
data entry forms against views, but changing the backend on this
point won't be an easy sell.

            regards, tom lane

pgsql-general by date:

Previous
From: "Ken Winter"
Date:
Subject: Why does an ON SELECT rule have to be named "_RETURN"?
Next
From: Chris
Date:
Subject: Re: Insert more than one t-uple in a single sql