Re: Deferrerable Check constraints

From: Bruce Hyatt <brucejhyatt(at)yahoo(dot)com>
To: pgsql-novice <pgsql-novice(at)postgresql(dot)org>, "Luiz K(dot) Matsumura" <luiz(at)planit(dot)com(dot)br>
Subject: Re: Deferrerable Check constraints
Date: 2008-11-24 18:35:49
Message-ID: 766394.9689.qm@web34401.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

--- On Mon, 11/24/08, Luiz K. Matsumura <luiz(at)planit(dot)com(dot)br> wrote:

> Hi All,
>
> Need a Help. Can a check constraint be deferred until the
> end of a transaction ?
> In other words, if i have a constraint like this:
>
> CREATE TABLE test
> (
> id serial NOT NULL,
> qt1 integer NOT NULL DEFAULT 0,
> qt2 integer NOT NULL DEFAULT 0,
> CONSTRAINT check_qt CHECK (qt1 <= qt2)
> )
>
> There are some manner that allow qt1 to be greater than qt2
> on a intermediate state of the transaction ?

Is this something that could be handled with update and/or insert triggers?

Bruce

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Luiz K. Matsumura 2008-11-24 22:51:58 Re: Deferrerable Check constraints
Previous Message Tom Lane 2008-11-24 13:54:15 Re: Deferrerable Check constraints