Re: creating "user" table

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: Chris <csmith(at)squiz(dot)net>
Cc: merlyn(at)stonehenge(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: creating "user" table
Date: 2001-09-23 23:19:22
Message-ID: 3BAE6DFA.D0B78BC3@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Chris wrote:
>
> Hey,
...
>
> > > False precondition!
> > >
> > > template1=# create database demo;
> > > CREATE DATABASE
> > > template1=# \c demo
> > > You are now connected to database demo.
> > > demo=# create table "user" (name text, age int);
...
>
> True, didn't give that example, but.. try that in another DBMS :) I know
> (at least) MySQL won't let you do that (*waits for the obvious comment*),
> don't know about other DBMS needing quotes around the name, but I don't
> think that one is portable to other systems :/

Its at least portable to Oracle, which behaves the same way as
PostgreSQL, BTW:

Connected to:
Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production
PL/SQL Release 8.0.5.0.0 - Production

SQL> CREATE TABLE USER (key INTEGER);
CREATE TABLE USER (key INTEGER)
*
ERROR at line 1:
ORA-00903: invalid table name

SQL> CREATE TABLE "user" (key INTEGER);

Table created.

>
> As Jochem pointed out in another post, by definition it's a reserved word
> (both sql92 & 99) so I'll go back to my corner again :)

Mike Mascari
mascarm(at)mascari(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message R Talbot 2001-09-23 23:41:05 Postgres Life of ...???
Previous Message R Talbot 2001-09-23 22:56:09 Postgres Life of ...???