Re: complex referential integrity constraints

From: "Joris Dobbelsteen" <Joris(at)familiedobbelsteen(dot)nl>
To: "Stephan Szabo" <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, "Robert Haas" <Robert(dot)Haas(at)dyntek(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: complex referential integrity constraints
Date: 2007-02-23 00:20:40
Message-ID: 73427AD314CC364C8DF0FFF9C4D693FF558A@nehemiah.joris2k.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>-----Original Message-----
>From: Stephan Szabo [mailto:sszabo(at)megazone(dot)bigpanda(dot)com]
>Sent: donderdag 22 februari 2007 23:13
>To: Joris Dobbelsteen
>Cc: Martijn van Oosterhout; Robert Haas; pgsql-general(at)postgresql(dot)org
>Subject: Re: [GENERAL] complex referential integrity constraints
>
>On Thu, 22 Feb 2007, Joris Dobbelsteen wrote:
>
>> >-----Original Message-----
>> >From: pgsql-general-owner(at)postgresql(dot)org
>> >[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of
>Martijn van
>> >Oosterhout
>> >Sent: donderdag 22 februari 2007 18:17
>> >To: Joris Dobbelsteen
>> >Cc: Robert Haas; pgsql-general(at)postgresql(dot)org
>> >Subject: Re: [GENERAL] complex referential integrity constraints
>> >
>> >On Thu, Feb 22, 2007 at 05:28:35PM +0100, Joris Dobbelsteen wrote:
>> >> Even worse, I don't you can guarentee that this constraint
>> >is enforced
>> >> at all times. That means, not if you are using triggers.
>> >> The only option seems using foreign keys and put in a lot of
>> >redundant
>> >> data.
>> >
>> >Err, foreign keys are implemented using triggers, so this statement
>> >is self-contradictary.
>>
>> Are you really sure they are executed under the same
>visibility rules?
>
>IIRC, the ri triggers use calls that you aren't able to get at
>in triggers written in any of the PLs, but I think you should
>be able to replicate the feat in a trigger written in C.

Why they never did that? No need or no pratical situations where it went
wrong?

IMHO it should become possible to expose this functionality to the PL
languages or as part of the trigger system? The current system can be
shown to be underpowered to enforce constraints. It seems a bit
cumbersome to have C functions for this purpose.

However I must admit that looking through the postgres code doesn't make
it much clearer to me whats actually going for these kind of tricky
problems...

- Joris

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrej Ricnik-Bay 2007-02-23 00:49:06 Re: postgresql vs mysql
Previous Message Steve Crawford 2007-02-23 00:16:36 Re: postgresql vs mysql