Re: constraint modification on todo list

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

Jeroen Ruigrok/asmodai <asmodai(at)wxs(dot)nl> writes:
> -On [20030909 00:42], Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2003-09-11 13:47:20 Re: Vote: Adding flex/bison derived files in WIN32_DEV
Previous Message Christopher Browne 2003-09-11 12:12:46 Re: Another small bug (pg_autovacuum)