Foreign Keys

Started by Anand Sureliaover 27 years ago5 messagesgeneral
Jump to latest
#1Anand 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

#2José Soares
jose@sferacarta.com
In reply to: Anand Surelia (#1)
Re: [GENERAL] Foreign Keys

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'

#3Aleksey Dashevsky
postgres@luckynet.co.il
In reply to: Anand Surelia (#1)
Re: [GENERAL] Foreign Keys

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:

Show quoted text

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

#4Anand Surelia
anand@bytekinc.com
In reply to: Aleksey Dashevsky (#3)
Re:Foreign Keys

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.

#5Jackson, DeJuan
djackson@cpsgroup.com
In reply to: Anand Surelia (#4)
RE: [GENERAL] Re:Foreign Keys

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.

Send on, Anand. you might also want to send a copy to the HACKERS list.
Did you make your option a final parameter so that it wouldn't break
existing apps?

-DEJ