Skip site navigation (1) Skip section navigation (2)

Re: The exact timing at which CHECK constraints are checked

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Takahiro Noda <noda(dot)takahiro(dot)47m(at)st(dot)kyoto-u(dot)ac(dot)jp>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: The exact timing at which CHECK constraints are checked
Date: 2011-12-15 06:41:24
Message-ID: 26634.1323931284@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Takahiro Noda <noda(dot)takahiro(dot)47m(at)st(dot)kyoto-u(dot)ac(dot)jp> writes:
> I'm new to PostgreSQL and having been learning SQL. I'm uncertain
> about the exact timing at which CHECK constraints are checked.

They're checked at the instant that a row is inserted or updated.
If you really need a deferred check, you'll need to build it yourself
using an AFTER ROW trigger.

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: pesiarDate: 2011-12-15 08:30:18
Subject: Help with installing pgAdmin 3
Previous:From: Takahiro NodaDate: 2011-12-15 04:55:51
Subject: The exact timing at which CHECK constraints are checked

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group