Re: AFTER triggers and constraints

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: David Greco <David_Greco(at)harte-hanks(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: AFTER triggers and constraints
Date: 2013-06-28 15:57:35
Message-ID: CA+U5nMLtzurokTvQLYf=GZYZBxnZ=WGjRKNiM+KeRa-Z3BM3mA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 28 June 2013 16:09, David Greco <David_Greco(at)harte-hanks(dot)com> wrote:

> Yes, renaming the trigger does in fact work. Any thoughts on the theory of
> this behavior? i.e. is this ANSI compliant? Or should there be a mechanism
> in place that guarantees the FK-enforcement trigger runs after all others?
>

Hmm, it doesn't conform to the SQL standard, which clarifies that with NOTE
31, p.66 in 4.17.2 though doesn't specifically mention triggers.

We claim conformance to the standard on this.

You can change the name of the constraint that implements the FKs on the
DDL but can't change the names of the underlying triggers except by doing
that directly, which doesn't seem that useful.

Should we have a parameter to define precedence of RI checks? We could hoik
out the triggers and execute them last, or leave them as they are,
depending upon the setting.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-06-28 16:17:31 Re: AFTER triggers and constraints
Previous Message David Greco 2013-06-28 15:09:12 Re: AFTER triggers and constraints