pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <barwick@gmx.net>
To: pocm@rnl.ist.utl.pt
To: pgsql-sql@postgresql.org
Subject: Re: pg with different sql?
Date: Sun, 13 Jan 2002 23:38:25 +0100
Message-ID: <200201132238.XAA22036@post.webmailer.de> (raw)
In-Reply-To: <87y9j1j4bj.fsf@localhost.localdomain>
References: <87y9j1j4bj.fsf@localhost.localdomain>

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



view thread (5+ messages)  latest in thread

Message-ID: <200201132238.XAA22036@post.webmailer.de>
Permalink:  ../200201132238.XAA22036@post.webmailer.de/
Also on:    postgresql.org/message-id/200201132238.XAA22036@post.webmailer.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: barwick@gmx.net, pocm@rnl.ist.utl.pt
  Subject: Re: pg with different sql?
  In-Reply-To: <200201132238.XAA22036@post.webmailer.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox