Re: [BUGS] Bug #545: Keyword USER not detected in CREATE VIEW

2001-12-28 Thread Thomas Lockhart
... > Here again the column cannot be named without using quotes. But I'd > see issuing a warning about it as unwarranted nannyism. Yup. I'm not suggesting a change, but the more explicit discussion on *why* this may be acceptable is probably helpful. I think we are pretty close in 'tude on the

Re: [BUGS] Bug #545: Keyword USER not detected in CREATE VIEW

2001-12-28 Thread Tom Lane
Thomas Lockhart <[EMAIL PROTECTED]> writes: > avi=> create view z as select x as user from y; > My expected result: an error message in CREATE VIEW >> This is not a bug, it is intentional behavior. "AS" names are not >> restricted to be non-reserved words. > Sure, but his point is that the resul

Re: [BUGS] Bug #545: Keyword USER not detected in CREATE VIEW

2001-12-28 Thread Thomas Lockhart
> > avi=> create view z as select x as user from y; > > My expected result: an error message in CREATE VIEW > This is not a bug, it is intentional behavior. "AS" names are not > restricted to be non-reserved words. Sure, but his point is that the resulting view has a column which is named "use

Re: [BUGS] Bug #545: Keyword USER not detected in CREATE VIEW

2001-12-28 Thread Tom Lane
[EMAIL PROTECTED] writes: > avi=> create view z as select x as user from y; > My expected result: an error message in CREATE VIEW This is not a bug, it is intentional behavior. "AS" names are not restricted to be non-reserved words. regards, tom lane

Re: [BUGS] Bug #545: Keyword USER not detected in CREATE VIEW

2001-12-28 Thread Darcy Buskermolen
This is because user is a "reserved" word. user is a macro for the function current_user() Try this SQL: SELECT user; It is best to change the table name from user to username; However it is probably a wise idea for Postgres to emit some sort of error on the create mentioning the reserved word

[BUGS] Bug #545: Keyword USER not detected in CREATE VIEW

2001-12-28 Thread pgsql-bugs
Avi Kivity ([EMAIL PROTECTED]) reports a bug with a severity of 3 The lower the number the more severe it is. Short Description Keyword USER not detected in CREATE VIEW Long Description The reserved keyword USER is rejected in CREATE TABLE, as expected: avi=> create table x (user varchar);