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@mascari.com