Re: pg with different sql?

Поиск
Список
Период
Сортировка
От Ian Barwick
Тема Re: pg with different sql?
Дата
Msg-id 200201132238.XAA22036@post.webmailer.de
обсуждение исходный текст
Ответ на pg with different sql?  (pocm@rnl.ist.utl.pt (Paulo J. Matos))
Список pgsql-sql
On Sunday 13 January 2002 23:04, Paulo J. Matos wrote:
> Hi all,
>
> I'm new to postgres and I'm doing a database project for a
> subject at college in postgres. I've studied databases using
> DataBases Management Systems by Ramakrishnan.
> I've done some create tables and at psql interactive prompt I've
> done:
> \i proj.sql
> (where proj.sql is the filename with the CREATE TABLEs)
>
> AFAIK, SQL is standard and should be the same for all DBMSs.

Happy April 1st! ;-)

Your statement would be true if you interpret it thus:

"There are SQL standards which in an ideal world would be 
implemented uniformly by all (R)DBMSs".

Unfortunately, in the real world each system has its own
very individual view of SQL, meaning only the most
basic statements are universally executable. Postgres
is pretty close to SQL92 AFAIK.

> For example:
> CREATE TABLE socio (
>     id integer SERIAL PRIMARY KEY,
>     nome varchar,
>     alcunha string,
>     data_filiacao date)
>
> CREATE TABLE paga_cota (
>     ano integer,
>     mes integer,
>     valor integer,
>     id integer,
>     PRIMARY KEY(id,ano,mes),
>     FOREIGN KEY(id) REFERENCES(socio))
>
>
> After this I get an error around CREATE (of the 2nd table). I
> just can't imagine what it might be.

Nor can anyone else, if you don't provide the error message...

Just a wild guess, but try reading up on the SERIAL and STRING
data types ;-)

The docs are a good starting point:

http://www.postgresql.org/idocs/

particularly the SQL reference:

http://www.postgresql.org/idocs/index.php?reference.html


HTH 

Ian Barwick


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

Предыдущее
От: Jean-Luc Lachance
Дата:
Сообщение: Re: pg with different sql?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg with different sql?