Re: constraint modification on todo list

From: Jeroen Ruigrok/asmodai <asmodai(at)wxs(dot)nl>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: constraint modification on todo list
Date: 2003-09-08 21:01:43
Message-ID: 20030908210143.GG88340@nexus.ninth-circle.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

-On [20030908 22:42], Bruce Momjian (pgman(at)candle(dot)pha(dot)pa(dot)us) wrote:
>I assume MODIFY would allow you to alter the constraint without
>re-checking all the rows, as would be required by DROP/ADD. However, if
>you are modifying the constraint, wouldn't we have to recheck all the
>rows anyway. Of course, one idea would be to allow MODIFY to make
>changes that _don't_ require rechecking, but I have no idea what such
>changes would be.

I might have misread/misremembered something:

Constraint State Modification

You can use the MODIFY CONSTRAINT clause of the ALTER TABLE statement to
change the following constraint states:

* DEFERRABLE or NOT DEFERRABLE
* INITIALLY DEFERRED or INITIALLY IMMEDIATE
* RELY or NORELY
* USING INDEX ...
* ENABLE or DISABLE
* VALIDATE or NOVALIDATE
* EXCEPTIONS INTO ...

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_32a.htm#2103836

I wonder if it is possible to have ALTER TABLE ... MODIFY CONSTRAINT ...
CHECK ...
Because what I can imagine, and please correct me if I miss something in
my thought pattern, you have a small gap between dropping a constraint
and adding the new one allowing the possibility of missing checks.
Or would this be solved by adding a second constraint under another
constraint name with the new constraint values and then dropping the
older one? If so, then ALTER TABLE ... RENAME CONSTRAINT would come in
handy.

--
Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai
PGP fingerprint: 2D92 980E 45FE 2C28 9DB7 9D88 97E6 839B 2EAC 625B
http://www.tendra.org/ | http://www.in-nomine.org/~asmodai/diary/
Things should be made as simple as possible, but not any simpler...

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-09-08 21:05:14 Re: ISO 8601 "Time Intervals" of the "format with time-unit
Previous Message Andrew Dunstan 2003-09-08 21:01:38 Re: pgsql in shared lib