Re: [HACKERS] constraint modification on todo list

2003-09-15 Thread Gaetano Mendola
"Jeroen Ruigrok/asmodai" <[EMAIL PROTECTED]> wrote: > -On [20030911 15:43], Tom Lane ([EMAIL PROTECTED]) wrote: > >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 c

Re: [HACKERS] constraint modification on todo list

2003-09-11 Thread Jeroen Ruigrok/asmodai
-On [20030911 15:43], Tom Lane ([EMAIL PROTECTED]) wrote: >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 fea

Re: [HACKERS] constraint modification on todo list

2003-09-11 Thread Tom Lane
Jeroen Ruigrok/asmodai <[EMAIL PROTECTED]> writes: > -On [20030909 00:42], Tom Lane ([EMAIL PROTECTED]) 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.

Re: [HACKERS] constraint modification on todo list

2003-09-10 Thread Jeroen Ruigrok/asmodai
-On [20030909 00:42], Tom Lane ([EMAIL PROTECTED]) 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?

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > 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. >

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Oh, you bring up two important issues --- one is is the gap in time > between the drop and the recreate. This case can be done by > doing the query in a transaction --- the lock will exist until the > transaction completes, and in fact, you can roll it b

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Bruce Momjian
Jeroen Ruigrok/asmodai wrote: > -On [20030908 22:42], Bruce Momjian ([EMAIL PROTECTED]) 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 rech

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Gaetano Mendola
"Tom Lane" <[EMAIL PROTECTED]> wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > 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 th

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Gaetano Mendola
"Jeroen Ruigrok/asmodai" <[EMAIL PROTECTED]> wrote: > 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. I think, someone correct me i

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Tom Lane
Jeroen Ruigrok/asmodai <[EMAIL PROTECTED]> writes: > 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. If you're concerned about conc

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > 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. Yeah. Rod's point about alt

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Jeroen Ruigrok/asmodai
-On [20030908 22:42], Bruce Momjian ([EMAIL PROTECTED]) 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,

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Bruce Momjian
Tom Lane wrote: > Jeroen Ruigrok/asmodai <[EMAIL PROTECTED]> writes: > > can someone add: > > Add an ALTER TABLE MODIFY CONSTRAINT > > item to the todo list? > > Why? For a constraint, it's not obvious what this would do for you that > dropping and re-adding the constraint wouldn't do. In the pl

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Tom Lane
Jeroen Ruigrok/asmodai <[EMAIL PROTECTED]> writes: > can someone add: > Add an ALTER TABLE MODIFY CONSTRAINT > item to the todo list? Why? For a constraint, it's not obvious what this would do for you that dropping and re-adding the constraint wouldn't do. In the places where we support CREATE O

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Jeroen Ruigrok/asmodai
-On [20030908 20:52], Rod Taylor ([EMAIL PROTECTED]) wrote: >This could be rather time consuming to actually write but having the >ability to change foreign key on update / on delete modes without >rechecking all of the data would be very useful. I was more interested in this feature for CHECK con

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Rod Taylor
On Mon, 2003-09-08 at 14:32, Jeroen Ruigrok/asmodai wrote: > Hi people, > > can someone add: > > Add an ALTER TABLE MODIFY CONSTRAINT > > item to the todo list? I am even willing to pick this one up in a > while, after I finish some other outstanding tasks. This could be rather time consuming

[HACKERS] constraint modification on todo list

2003-09-08 Thread Jeroen Ruigrok/asmodai
Hi people, can someone add: Add an ALTER TABLE MODIFY CONSTRAINT item to the todo list? I am even willing to pick this one up in a while, after I finish some other outstanding tasks. -- Jeroen Ruigrok van der Werven / asmodai PGP fingerprint: 2D92 980E 45FE 2C28 9DB7 9D88 97E6 839B 2EAC 625