Re: [HACKERS] CREATE VIEW fix - Mailing list pgsql-hackers

From Ross J. Reedstrom
Subject Re: [HACKERS] CREATE VIEW fix
Date
Msg-id 20000307134154.D21828@rice.edu
Whole thread Raw
In response to CREATE VIEW fix  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
On Tue, Mar 07, 2000 at 04:14:35PM +0000, Thomas Lockhart wrote:
> I've got patches to fix the CREATE VIEW command to support SQL92
> syntax for result column names, a la
> 
>   CREATE VIEW (a, b, c) AS SELECT ...
> 
> It is an almost trivial fix, requiring the addition of a single field
> in the View structure and a few lines of code in analyze.c.
> 

Hmm, couldn't you just rewrite the SELECT d, e, f ... part to use the 
AS syntax? I was thinking that both:
  CREATE VIEW (a, b, c) AS SELECT d, e, f ...  CREATE VIEW AS SELECT d AS a, e AS b, f AS c ...

should result in the same VIEW being created. But, hey, don't let me
knock already written code! 

> I'll commit this at the same time I commit support for the SQL92
> OVERLAPS operator, which will need an initdb anyway since there are a
> few new functions in pg_proc. I believe that we have at least one
> other patch coming which will force an initdb anyway, and I'll
> coordinate with that.
> 
>                       - Thomas

Excellent: Both changes will help with the NIST test suite I'm (trying)
to run.

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] alter_table.sql
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Re: [BUGS] uniqueness not always correct