Foreign Keys
Foreign Keys
От:
Anand Surelia <anand@bytekinc.com>
Дата:
Hi, What do I have to do to implement Foreign Keys in Postgres 6.3.2 ? Does anyone have the set of triggers to implement it? When is new version which implements it is being released? Thanks, Anand
Re: [GENERAL] Foreign Keys
От:
"Jose' Soares" <jose@sferacarta.com>
Дата:
Anand Surelia wrote: > > Hi, > What do I have to do to implement Foreign Keys in Postgres 6.3.2 ? > > Does anyone have the set of triggers to implement it? Take a look at Postgresql-6.3.2/contrib/spi/refint* there's an example how to implement referential integrity using triggers. > When is new version which implements it is being released? I don't know but I hope soon. Jose'
Re: [GENERAL] Foreign Keys
От:
Aleksey Dashevsky <postgres@luckynet.co.il>
Дата:
hi! You should check in contrib/spi subdirectory of Postgres source. There are some useful triggers here, and some of them dedicated to referential integrity. Al. On Thu, 10 Sep 1998, Anand Surelia wrote: > Hi, > What do I have to do to implement Foreign Keys in Postgres 6.3.2 ? Does > anyone have the set of triggers to implement it? When is new version > which implements it is being released? > Thanks, > Anand > >
Re:Foreign Keys
От:
Anand Surelia <anand@bytekinc.com>
Дата:
Hi, I've managed to hack the code for check_primary_key. It now allows for a option [automatic|dependent]. It'll automatically insert into the parent table if the primary key doesn't exists in the parent table and if the option is "automatic". It works the same as before if the option is "dependent". If anybody is interested I might polish the code a bit and post to the list. Thanks, Anand.