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

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
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 end of

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 I did, and all

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 SQL

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

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 constraints or triggers

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 Postgres is this and do you

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

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 this one?

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?

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?

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

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

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