Re: constraint modification on todo list - Mailing list pgsql-hackers

From Tom Lane
Subject Re: constraint modification on todo list
Date
Msg-id 26196.1063287814@sss.pgh.pa.us
Whole thread Raw
In response to Re: constraint modification on todo list  (Jeroen Ruigrok/asmodai <asmodai@wxs.nl>)
Responses Re: constraint modification on todo list
List pgsql-hackers
Jeroen Ruigrok/asmodai <asmodai@wxs.nl> writes:
> -On [20030909 00:42], Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> IIRC, Oracle does not have rollback-able DDL.  That might imply that the
>> reason they have MODIFY CONSTRAINT is that in Oracle you can't use the
>> above way to eliminate the window.  Can you put ALTERs inside
>> transactions at all in Oracle?

> As one of the Oracle gurus at work told me:

> DDL does an implicit commit, so no rollback possible.
> It also shouldn't be necessary, because you cannot change a table which
> is in use.
> It attempts to do a table lock and it fails.

Is that their excuse?

We can't ALTER a table that's already in use when the first ALTER
starts, either --- its attempt to exclusive-lock the table will fail.
But once you get the exclusive lock, you can (in Postgres) perform
a series of operations without fear that subsequently-started
transactions will be able to see the incompletely changed state of the
table.  Evidently Oracle can't handle that.  That's why they need to
invent combination operations like MODIFY CONSTRAINT.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Christopher Browne
Date:
Subject: Re: Another small bug (pg_autovacuum)
Next
From: Andrew Dunstan
Date:
Subject: Re: Vote: Adding flex/bison derived files in WIN32_DEV