Where did you get the idea that Foreign Key was no
longer supported? It works fine on my 7.1.2 box:
processdata=> select version(); version
---------------------------------------------------------------PostgreSQL 7.1.2 on i686-pc-linux-gnu, compiled by
GCC 2.95.4
(1 row)
processdata=> CREATE TABLE foo (tes_key varchar(5)
PRIMARY KEY);
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit
index 'foo_pkey' for table 'foo'
CREATE
processdata=> CREATE TABLE bar (bar_key SERIAL, foo_id
varchar(5) REFERENCES foo);
NOTICE: CREATE TABLE will create implicit sequence
'bar_bar_key_seq' for SERIAL column 'bar.bar_key'
NOTICE: CREATE TABLE/UNIQUE will create implicit
index 'bar_bar_key_key' for table 'bar'
NOTICE: CREATE TABLE will create implicit trigger(s)
for FOREIGN KEY check(s)
CREATE
Good Luck,
Jason
--- Lorenzo De Vito <lorenzodevito@email.it> wrote:
> What's the best way to build a relation between two
> tables ?
> I know that Foreign key is no longer supported.
>
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/