Re: pointer to feature comparisons, please - Mailing list pgsql-general

From PFC
Subject Re: pointer to feature comparisons, please
Date
Msg-id op.ttwhjth2cigqcu@apollo13
Whole thread Raw
In response to Re: pointer to feature comparisons, please  (Ron Johnson <ron.l.johnson@cox.net>)
Responses Re: pointer to feature comparisons, please
List pgsql-general
>>> The DELETE should block, no?
>>      Why ?
>>      Foreign keys put an ON DELETE trigger on the referenced table
>
> Foreign keys that silently, automatic DELETE records?
> Did I read that correctly?

    Isn't that the point of ON DELETE CASCADE ?

>> besides checking the referencing column on insert/update... If you just
>> implement a constraint, you only get half the functionality.
>
> But when I define a FK *constraint*, that's all I *want*!

    When you add a REFERENCE foo( bar ) foreign key and don't specify ON
DELETE clause, I believe you get ON DELETE NO ACTION, which means the
referenced row can't be deleted if there are referencing rows...  so when
you have a FK constraint, it actually constrains two tables, and pg uses
share locking to ensure race conditions can't cause an inconsistent
database.



pgsql-general by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: [SQL] function to find difference between in days between two dates
Next
From: "Manso Gomez, Ramon"
Date:
Subject: Re: [SQL] setof or array as input parameter to postgresql 8.2 functions