Re: Question about CONSTRAINT TRIGGER

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: ZM Yang <zmpgzm(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question about CONSTRAINT TRIGGER
Date: 2015-06-27 02:23:30
Message-ID: CAKFQuwa7oHYy0wv5qeAQhvjvaX_FMr+=B+9D1+5ZhSmi8k4qiw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday, June 26, 2015, ZM Yang <zmpgzm(at)gmail(dot)com> wrote:

> Hi folks,
>
> I'm confused about the usage of CONSTRAINT TRIGGER. More specifically, the
> documentation says that the name of another table referenced by the
> constraint can be specified in a FROM clause:
>
> "The (possibly schema-qualified) name of another table referenced by the
> constraint. This option is used for foreign-key constraints and is not
> recommended for general use. This can only be specified for constraint
> triggers."
>
> (1)
> How can the table name specified in the the FROM clause be used? It seems
> that it cannot be referenced in the WHERE clause. (Please correct me if I'm
> wrong)
>
> (2)
> How is the table specified in the FROM clause used for FK constraints?
>
> Thanks,
> ZM
>

I presume these are used by the system to choose between different triggers
based upon which PK table caused the on update or on delete cascade to
start. Think of it as another kind of when clause.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Nikander 2015-06-27 03:59:05 use null or 0 in foreign key column, to mean "no value"?
Previous Message David G. Johnston 2015-06-27 02:13:53 Re: How to convert a text variable into a timestamp in postgreSQL?