Re: Cannot create tabel named 'user' - Mailing list pgsql-bugs

From Harry W. Waddell
Subject Re: Cannot create tabel named 'user'
Date
Msg-id Pine.NEB.4.10.10008291649550.4357-100000@scimitar.caravan.com
Whole thread Raw
In response to Cannot create tabel named 'user'  (pgsql-bugs@postgresql.org)
List pgsql-bugs
User is a key word, so the psql parser gets confused when you try to do:

create table user (....

but

create table "user" (...

will work. All references to the table will have to be in quotes as well.
FWIW, I'd use a different table name. e.g. yoyodyne_user.

HW
On Tue, 29 Aug 2000 pgsql-bugs@postgresql.org wrote:

> Roman Solomatin (roman.solomatin@tele2.ee) reports a bug with a severity of 3
> The lower the number the more severe it is.
>
> Short Description
> Cannot create tabel named 'user'
>
> Long Description
> Cannot create a table named user no matter if the database is old or freshly created. It may be version specific,
becauseI have PostgreSQL 6.5.3 and system administrator doesn't update it to 7.x version. 
>
> Sample Code
> In psql:
> template1=> create database new_database;
> CREATEDB
> template1=> \c new_database
> connecting to new database: new_database
> new_database=> create table user ( id int2 not null );
> ERROR:  parser: parse error at or near "user"
> new_database=> create table users (id int2 not null );
> CREATE
> new_database=>
>
> No file was uploaded with this report
>
>
>

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: table aliases with updates
Next
From: Stephan Szabo
Date:
Subject: Re: table aliases with updates