Re: [GENERAL] simple update query stuck

2014-04-02 Thread Si Chen
Ok, thanks. I'll keep that in mind. On Tue, Apr 1, 2014 at 7:45 PM, Andrew Sullivan wrote: > On Tue, Apr 01, 2014 at 07:00:16PM -0400, Tom Lane wrote: > > > one of the clients, in a way that isn't visible to the deadlock detector. > > One way for that to happen without any external interconnec

Re: [GENERAL] simple update query stuck

2014-04-01 Thread Andrew Sullivan
On Tue, Apr 01, 2014 at 07:00:16PM -0400, Tom Lane wrote: > one of the clients, in a way that isn't visible to the deadlock detector. > One way for that to happen without any external interconnections is if the > client is waiting for a NOTIFY that will never arrive because the would-be > sender i

Re: [GENERAL] simple update query stuck

2014-04-01 Thread Tom Lane
Andrew Sullivan writes: > Probably you could have killed one of the queries. But it sounds like > what's happening is that you have multiple queries that are all trying > to update the same rows in a different order. It may be that none of > these is strictly deadlocked, in that no query is wait

Re: [GENERAL] simple update query stuck

2014-04-01 Thread David Johnston
Andrew Sullivan-8 wrote > On Tue, Apr 01, 2014 at 01:37:17PM -0700, Si Chen wrote: >> You are right. That was the problem. I tried the query from >> http://wiki.postgresql.org/wiki/Lock_Monitoring and found a COMMIT >> transaction that was blocking it. >> >> I restarted postgresql again, and (it

Re: [GENERAL] simple update query stuck

2014-04-01 Thread Andrew Sullivan
On Tue, Apr 01, 2014 at 01:37:17PM -0700, Si Chen wrote: > You are right. That was the problem. I tried the query from > http://wiki.postgresql.org/wiki/Lock_Monitoring and found a COMMIT > transaction that was blocking it. > > I restarted postgresql again, and (it seems) everything went back to

Re: [GENERAL] simple update query stuck

2014-04-01 Thread Si Chen
You are right. That was the problem. I tried the query from http://wiki.postgresql.org/wiki/Lock_Monitoring and found a COMMIT transaction that was blocking it. I restarted postgresql again, and (it seems) everything went back to normal. Was there another way to unlock the table then? On Tue,

Re: [GENERAL] simple update query stuck

2014-04-01 Thread Si Chen
Thanks for writing back, but I don't think so. There's no message of a deadlock in the log, and the first query started at 12:25, the next one 12:31, 12:39, 12:50, 12:54, so there's plenty of time in between. On Tue, Apr 1, 2014 at 1:01 PM, Hoover, Jeffrey wrote: > Could they both be trying to

Re: [GENERAL] simple update query stuck

2014-04-01 Thread Igor Neyman
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Si Chen Sent: Tuesday, April 01, 2014 3:51 PM To: pgsql-general@postgresql.org Subject: [GENERAL] simple update query stuck Hello, I'm using postgresql 9.0.13, and I have a simple query that seems

Re: [GENERAL] simple update query stuck

2014-04-01 Thread Paul Jungwirth
Do these queries update more than one row? I ran into a similar issue a year ago, where two multi-row updates would deadlock because they processed rows in a different order. I'd love to see UPDATE support ORDER BY to fix this, but it doesn't yet. (If I ever try contributing to Postgres, this is a