Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Michael Fuhr
On Tue, Sep 28, 2004 at 01:35:32PM -0400, Shawn Chisholm wrote: > create table locations > ( > id serial, > address varchar, > ... > ) > > -- In the real application there are 5 tables like this > create table a1 > ( > from int, > to int, > ... > FOREIGN KEY (from) r

Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Michael Fuhr
On Tue, Sep 28, 2004 at 10:27:21PM +, Randy Yates wrote: > I see the light. You mean it would be nice to be able to have a > "LOCK-FOR-UPDATE-ONLY" > lock as well as a "LOCK-FOR-UPDATE-OR-READ" lock, but all you have now is > "LOCK-FOR-UPDATE-OR-READ" and that gets applied even when you don't

Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Randy Yates
[EMAIL PROTECTED] (Stephan Szabo) writes: > On Tue, 28 Sep 2004, Randy Yates wrote: > >> Michael Fuhr <[EMAIL PROTECTED]> writes: >> >> > On Tue, Sep 28, 2004 at 01:30:08PM +, Randy Yates wrote: >> >> Randy Yates <[EMAIL PROTECTED]> writes: >> >> > >> >> > I'm confused. Where is the lock? Is i

Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Stephan Szabo
On Tue, 28 Sep 2004, Randy Yates wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > > On Tue, Sep 28, 2004 at 01:30:08PM +, Randy Yates wrote: > >> Randy Yates <[EMAIL PROTECTED]> writes: > >> > > >> > I'm confused. Where is the lock? Is it on the 1 record in the model table? > > > > Yes. >

Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Randy Yates
Michael, Thank you for your responses. Further questions below. Michael Fuhr <[EMAIL PROTECTED]> writes: > On Tue, Sep 28, 2004 at 01:30:08PM +, Randy Yates wrote: >> Randy Yates <[EMAIL PROTECTED]> writes: >> > >> > I'm confused. Where is the lock? Is it on the 1 record in the model table?

Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Shawn Chisholm
o: Shawn Chisholm Cc: [EMAIL PROTECTED] Subject: Re: [GENERAL] Foreign key order evaluation On Mon, Sep 27, 2004 at 03:19:47PM -0400, Shawn Chisholm wrote: > > Hi, I am trying to deal with a deadlock situation caused by foreign > key references on insert and I was wondering if anyone k

Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Gaetano Mendola
Michael Fuhr wrote: On Tue, Sep 28, 2004 at 01:30:08PM +, Randy Yates wrote: Randy Yates <[EMAIL PROTECTED]> writes: I'm confused. Where is the lock? Is it on the 1 record in the model table? Yes. If so, why is that record locked? Is it possible in Postgresql to update the primary key of a re

Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Michael Fuhr
On Tue, Sep 28, 2004 at 01:30:08PM +, Randy Yates wrote: > Randy Yates <[EMAIL PROTECTED]> writes: > > > > I'm confused. Where is the lock? Is it on the 1 record in the model table? Yes. > > If so, why is that record locked? Is it possible in Postgresql to update > > the primary key of a reco

Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Randy Yates
Randy Yates <[EMAIL PROTECTED]> writes: > Mike, > > I'm confused. Where is the lock? Is it on the 1 record in the model table? > If so, why is that record locked? Is it possible in Postgresql to update > the primary key of a record? Let me also ask why this is a problem. It may be a lock situati

Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Randy Yates
Mike, I'm confused. Where is the lock? Is it on the 1 record in the model table? If so, why is that record locked? Is it possible in Postgresql to update the primary key of a record? --RY [EMAIL PROTECTED] (Michael Fuhr) writes: > On Mon, Sep 27, 2004 at 03:19:47PM -0400, Shawn Chisholm wrote:

Re: [GENERAL] Foreign key order evaluation

2004-09-27 Thread Michael Fuhr
On Mon, Sep 27, 2004 at 03:19:47PM -0400, Shawn Chisholm wrote: > > Hi, I am trying to deal with a deadlock situation caused by foreign > key references on insert and I was wondering if anyone knows what > order the foreign keys are locked (or evaluated) in for a particular > table? Deferring the