NOT DEFERRABLE vs. DEFERRABLE INITIALLY IMMEDIATE constraints

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: NOT DEFERRABLE vs. DEFERRABLE INITIALLY IMMEDIATE constraints
Date: 2014-02-06 19:26:03
Message-ID: CAMkU=1zQ0YtnthMSsDPuDfcmzL5jwZ-GbJNwB-LJS7Q7gJCK0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've been plagued several times by NOT DEFERRABLE constraints. Is there
any good reason to define a constraint as NOT DEFERRABLE rather
than DEFERRABLE INITIALLY IMMEDIATE? For example, is there performance
penalty for PostgreSQL being prepared to defer a constraint even though it
is not currently being deferred?

The only downside I see to DEFERRABLE INITIALLY IMMEDIATE is that a naive
user could needless set it to deferred, and thus use more memory/time than
they otherwise would. But there are so many ways for naive users to shoot
themselves in the foot, I fail to see the point in foreclosing this one
possibility.

Cheers,

Jeff

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-02-06 19:46:02 Re: NOT DEFERRABLE vs. DEFERRABLE INITIALLY IMMEDIATE constraints
Previous Message Rob Sargent 2014-02-06 19:01:22 Re: Ordering Results by a Supplied Order