Re: ENABLE/DISABLE CONSTRAINT NAME

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: wangshuo(at)highgo(dot)com(dot)cn
Cc: David Johnston <polobo(at)yahoo(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Re: ENABLE/DISABLE CONSTRAINT NAME
Date: 2013-09-09 12:54:32
Message-ID: 522DC508.1000509@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/3/13 3:13 AM, wangshuo(at)highgo(dot)com(dot)cn wrote:
> Drop/build and disable/enable constraint has no fundamental difference,
> and could achieve the same purpose.What I do also more convenient for
> the user.
> Recording the disabled constraints is easier than recoding all the
> constrains.

Note that other schema objects can depend on the existence of
constraints. For example, the validity of a view might depend on the
existence of a primary key constraint. What would you do with the view
if the primary key constraint is temporarily disabled?

> What's more, a lot of people ever asked about turing off constraint and
> The sql2008 support this.So I think it's necessary in some ways.

I don't see this in the SQL standard. There is [NOT] ENFORCED, but
that's something different. Implementing that instead might actually
address the above concern.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-09-09 14:25:10 Re: [bug fix] strerror() returns ??? in a UTF-8/C database with LC_MESSAGES=non-ASCII
Previous Message Vesa-Matti J Kari 2013-09-09 12:36:15 Re: Strange hanging bug in a simple milter