Foreign Key in PostGreSQL

From: Filipi Damasceno Viana <filipi(at)em(dot)pucrs(dot)br>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Foreign Key in PostGreSQL
Date: 1999-06-02 20:29:36
Message-ID: 199906022029.RAA01953@europa.em.pucrs.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I am a universitary student from BRASIL, and Im using PostGreSQL data base.
Im designing my data base and I have one question.
How to create a foreing key in PostGreSQL.
Im using the following command:
CREATE TABLE test(
pnr char(10),
nome char(20),
id decimal REFERENCE <parent table>);

and

CREATE TABLE test(
pnr char(10),
nome char(20),
id decimal,
FOREING KEY (id) REFERENCES <parent table>);

Where parent table is the table with the primary key.

Regards

Filipi Damasceno Vianna
&
Alessandro Orso

Browse pgsql-hackers by date

  From Date Subject
Next Message David Sauer 1999-06-02 21:00:40 current CVS snapshot of pgsql crash ...
Previous Message Nat Howard 1999-06-02 19:23:38 RE: [HACKERS] Re: [SQL] Column name's length