Tom Lane wrote:
> 
> [EMAIL PROTECTED] writes:
> > -- Rule over the referenced table
> > -- which breaks referential integrity
> > create rule nodelrel
> > as on delete to rel
> > where old.ref > 3 and user = 'prueba'
> > do instead nothing;
> 

Hi Tom,

        first of all, my congratulations to the PostgreSQL team, for this fantastic
ORDBMS. I'm working with it since 6.4.2 version, and each improvement since then
is placing PostgreSQL above the other (commercial and non-commercial) products.

> This rule is preventing the foreign key triggers from performing the
> DELETEs implied by your ON DELETE CASCADE command.  If we made the
> triggers bypass the rules, we'd get other complaints about that.
> At the moment, the rule wins.  If you want to propose a different
> behavior, let's hear it.

        But, PostgreSQL makes an external (not internal) difference among triggers and
constraint triggers (described as special and for internal use in the reference
manual). Surely there are many reasons to have only one level of triggers (I'm
thinking on two or three now), but why don't two levels? The first level with
triggers, which can be bypassed by rules, and the second level with constraint
triggers, which cannot be bypassed by them.

        Following with the two levels concept, when you define a trigger you could have
a parameter to set the 'unbypassable' behaviour (with the normal one set as
default), so the database designer could choose when she/he/it needs to tune a
complex design.

        Best regards,
                Jos� Mar�a Fern�ndez

-- 
Jos� Mar�a Fern�ndez Gonz�lez           e-mail: [EMAIL PROTECTED]
Tlfn:   (+34) 91 585 49 21              Fax:    (+34) 91 585 45 06
Grupo de Dise�o de Proteinas            Protein Design Group
Centro Nacional de Biotecnolog�a        National Center of Biotechnology
C.P.: 28049                             Zip Code: 28049
Campus Universidad Aut�noma. Cantoblanco, Madrid, Spain.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to