Re: Intervals (was: [GENERAL] DeadLocks..., DeadLocks...)

2007-06-18 Thread Alban Hertroys
Tom Allison wrote: > I have a question though. > I noticed a particular format for identifying dates like: > now()-'3 days'::interval; > > What's '::interval' and why should I use it? Intervals are convenient, simply said. They are a special type dealing with date calculations relative to a given

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-15 Thread Tom Allison
Gregory Stark wrote: "Tom Allison" <[EMAIL PROTECTED]> writes: The other approach would be to use an external file to queue these updates and run them from a crontab. Something like: and then run a job daily to read all these in to a hash (to make them unique values) and then run one SQ

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-15 Thread Alvaro Herrera
Tom Allison wrote: > Terry Fielder wrote: > > > >My 2 cents: > > > >I used to get a lot of these sharelock problems. > >Users using different records, but same tables in different order. > >(apparently 7.x was not as good as 8.x at row level locking) > > > >I was advised to upgrade from 7.x to 8.x

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-15 Thread Gregory Stark
"Tom Allison" <[EMAIL PROTECTED]> writes: > The other approach would be to use an external file to queue these updates and > run them from a crontab. Something like: ... > and then run a job daily to read all these in to a hash (to make them unique > values) and then run one SQL statement at the

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-15 Thread Tom Allison
Gregory Stark wrote: The insert is deadlocking against the update delete. The problem is that the insert has to lock the records to be sure they aren't deleted. This prevents the update for updating them. But the update has already updated some other records which the insert hasn't referred to

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-15 Thread Gregory Stark
The insert is deadlocking against the update delete. The problem is that the insert has to lock the records to be sure they aren't deleted. This prevents the update for updating them. But the update has already updated some other records which the insert hasn't referred to yet. When the insert tr

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-14 Thread Terry Fielder
My 2 cents: I used to get a lot of these sharelock problems. Users using different records, but same tables in different order. (apparently 7.x was not as good as 8.x at row level locking) I was advised to upgrade from 7.x to 8.x I did, and all those sharelock problems went away. Terry Terry F

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-14 Thread Tom Allison
Terry Fielder wrote: My 2 cents: I used to get a lot of these sharelock problems. Users using different records, but same tables in different order. (apparently 7.x was not as good as 8.x at row level locking) I was advised to upgrade from 7.x to 8.x I did, and all those sharelock problems wen

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-14 Thread Tom Allison
Tom Allison wrote: Gregory Stark wrote: I'm still not precisely clear what's going on, it might help if you posted the actual schema and the deadlock message which lists the precise locks that deadlocked. Are any of the DML you mention on other tables on those tables with foreign key refe

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-14 Thread Tom Allison
Gregory Stark wrote: I'm still not precisely clear what's going on, it might help if you posted the actual schema and the deadlock message which lists the precise locks that deadlocked. Are any of the DML you mention on other tables on those tables with foreign key references to this one? It's

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-14 Thread Tom Allison
Gregory Stark wrote: I'm still not precisely clear what's going on, it might help if you posted the actual schema and the deadlock message which lists the precise locks that deadlocked. Are any of the DML you mention on other tables on those tables with foreign key references to this one? It's

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-14 Thread Alvaro Herrera
Gregory Stark wrote: > > I'm still not precisely clear what's going on, it might help if you posted the > actual schema and the deadlock message which lists the precise locks that > deadlocked. > > Are any of the DML you mention on other tables on those tables with foreign > key references to thi

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-14 Thread Gregory Stark
I'm still not precisely clear what's going on, it might help if you posted the actual schema and the deadlock message which lists the precise locks that deadlocked. Are any of the DML you mention on other tables on those tables with foreign key references to this one? It's impossible for two ins

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-14 Thread Bill Moran
In response to <[EMAIL PROTECTED]>: > > On 6/14/2007, "Gregory Stark" <[EMAIL PROTECTED]> wrote: > > > > > > ><[EMAIL PROTECTED]> writes: > > > >> But everyone once in a long while it seems that I hit simultaneaous > >> execute() statements that deadlock on the insertion. > > > >What version of P

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-14 Thread tom
On 6/14/2007, "Gregory Stark" <[EMAIL PROTECTED]> wrote: > > ><[EMAIL PROTECTED]> writes: > >> But everyone once in a long while it seems that I hit simultaneaous >> execute() statements that deadlock on the insertion. > >What version of Postgres is this and do you have any foreign key constraint

Re: [GENERAL] DeadLocks..., DeadLocks...

2007-06-14 Thread Gregory Stark
<[EMAIL PROTECTED]> writes: > But everyone once in a long while it seems that I hit simultaneaous > execute() statements that deadlock on the insertion. What version of Postgres is this and do you have any foreign key constraints or triggers on the table you're inserting into? Is that insert the