Re: syntax troubles using "deferrable initially deferred"

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: syntax troubles using "deferrable initially deferred"
Date: 2009-09-15 02:29:20
Message-ID: 482E80323A35A54498B8B70FF2B8798004189C0B91@azsmsx504.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I believe I can "set constraints" to achieve the same thing?

I just don't want the check to happen until commit time. The users may make many row changes, the later ones "fixing" what the earlier ones would otherwise flag as problematic with the check.

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Monday, September 14, 2009 7:19 PM
To: Gauthier, Dave
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] syntax troubles using "deferrable initially deferred"

"Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> writes:
> create table templates
> (
> template text,
> constraint template_not_null_check (template is nit null) deferrable initially deferred);

> ERROR syntax error at or near "DEFERRABLE"
> LINE 4: ...nt template_not_null_check (template is not null) DEFERRABLE...

Sorry, there are no deferrable check constraints in Postgres.
We only handle deferrable foreign keys (8.5 will have deferrable
unique also). By and large there isn't any good reason that I
can see for a deferrable check constraint --- you might as well
check the row when it goes in. (If you are trying something cute
that depends on the timing of the check, be advised that it probably
wouldn't work reliably anyway.)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-09-15 02:45:41 Re: syntax troubles using "deferrable initially deferred"
Previous Message Vikram Patil 2009-09-15 01:55:26 Re: Regarding initdb & pg_ctl