Re: Can arrays reference primary keys in CREATE TABLE? - Mailing list pgsql-sql

From Jan Wieck
Subject Re: Can arrays reference primary keys in CREATE TABLE?
Date
Msg-id 3EC91704.1080109@Yahoo.com
Whole thread Raw
In response to Can arrays reference primary keys in CREATE TABLE?  ("Filipe Bonjour" <fbonjour@urbanet.ch>)
Responses Re: Can arrays reference primary keys in CREATE TABLE?  (Luis Sousa <llsousa@ualg.pt>)
List pgsql-sql
Luis Sousa wrote:
> Richard Huxton wrote:
> 
>> On Friday 09 May 2003 10:21 pm, Filipe Bonjour wrote:
>>  
>>
>>> Hi,
>>>
>>> I'm a rather new SQL user, and I found interesting that you can
>>> use "references" to make sure that a value inserted in a table is a
>>> primary key from another table. Something like:
>>>   
>>
>>
>> Yep - referential integrity is vital.
>>
> I used a trigger to get referential integrity.
> So, on update or insert, it fires the function that's going to read the 
> new array and check if really exists on the other table

And what happens on UPDATE or DELETE to the primary key table?

You used a trigger to check something, but unless you have a full set of
said triggers and they do the locking as well, you do not have
referential integrity.


Jan


-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: COALESCE in ORDER BY...
Next
From: Jeff Boes
Date:
Subject: Performance on temp table inserts