Re: Can I assume there's only one _RETURN rule? - Mailing list pgsql-hackers

From Jim C. Nasby
Subject Re: Can I assume there's only one _RETURN rule?
Date
Msg-id 20060824090655.GB73562@pervasive.com
Whole thread Raw
In response to Re: Can I assume there's only one _RETURN rule?  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
On Thu, Aug 17, 2006 at 10:39:14PM -0400, Alvaro Herrera wrote:
> Another question.  The patch does a lot of scanning of the range table
> searching for specific aliases for things -- usually for *NEW* or *OLD*,
> but also to get the entry for the view we are modifying, etc.  This
> seems pretty fragile -- it breaks if I create a table named *OLD*, for
> example.  Is this acceptable?
> 
> alvherre=# create table "*OLD*" (a int);
> CREATE TABLE
> alvherre=# create view aaa as select * from "*OLD*";
> ERROR:  could not open relation with OID 0
> 
> On the other hand it doesn't break CVS tip at all, i.e. I can perfectly
> create the view and it works.  (I can even call it "*NEW*").

If we're going to allow this we should add a regression test for it,
since this seems like something that's likely to break.

Personally, I'd just say you can't name (or alias) something as "*OLD*"
or "*NEW*" and be done with it.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: An Idea for planner hints
Next
From: Markus Schiltknecht
Date:
Subject: Re: Replication