Re: creating "user" table

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема Re: creating "user" table
Дата
Msg-id 3BAE6DFA.D0B78BC3@mascari.com
обсуждение исходный текст
Ответ на Re: creating "user" table  (Chris <csmith@squiz.net>)
Список 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@mascari.com

В списке pgsql-general по дате отправления:

Предыдущее
От: missive@frontiernet.net (Lee Harr)
Дата:
Сообщение: Re: My brain hurts - update field based on value of another table's field
Следующее
От: R Talbot
Дата:
Сообщение: Re: Where are Perl DBI and DBD for PostgreSQL??