Re: Curosity question regarding "LOCK" NOWAIT

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: David Johnston <polobo(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Curosity question regarding "LOCK" NOWAIT
Date: 2012-09-22 08:04:48
Message-ID: 505D7120.7080300@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2012-09-22 07:55 keltezéssel, Josh Kupershmidt írta:
> On Fri, Sep 21, 2012 at 7:43 PM, David Johnston <polobo(at)yahoo(dot)com> wrote:
>> Has there been any discussion regarding adding a time-limited version of
>> NOWAIT, say: “WAITONLY 50” (milliseconds), when dealing the explicit LOCK
>> TABLE or the SELECT…FOR(SHARE|UPDATE) commands?
> I think you could do this by issuing
>
> SET statement_timeout = 50;
>
> and then attempting the LOCK TABLE or SELECT ... FOR UPDATE command,
> without NOWAIT. You'll either get an "ERROR: canceling statement due
> to statement timeout" or the command should succeed.

This is not the same as the handling of a timeout waiting for a lock.
The statement_timeout may also trigger when returning large
result sets without locking, i.e. in a plain SELECT case.

Best regards,,
Zoltán Böszörményi

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2012-09-22 08:15:49 Re: 9.1 vs 8.4 performance
Previous Message Boszormenyi Zoltan 2012-09-22 08:01:37 Re: Curosity question regarding "LOCK" NOWAIT