Cannot create tabel named 'user'

Поиск
Список
Период
Сортировка
Искать

Cannot create tabel named 'user'

От:
pgsql-bugs@postgresql.org
Дата:
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, because I 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

Re: Cannot create tabel named 'user'

От:
"Harry W. Waddell" <waddell@caravan.com>
Дата:
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, because I 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
> 
> 
>
FAQ