Thread: CREATE VIEW fix
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. 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 -- Thomas Lockhart lockhart@alumni.caltech.edu South Pasadena, California
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
> 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. > > 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. Sounds good. We may have some people running production on 7.0 beta. They will need to use pg_upgrade. -- Bruce Momjian | http://www.op.net/~candle pgman@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026
> > CREATE VIEW (a, b, c) AS SELECT ... > 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! Not at all. Next time I'll let you write it, since this is how I implemented it :) - Thomas -- Thomas Lockhart lockhart@alumni.caltech.edu South Pasadena, California