pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Job <Job@colliniconsulting.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: R: Problem with row-level lock
Date: Fri, 21 Jun 2019 07:34:33 -0700
Message-ID: <e09f4726-14e6-2d65-4765-35aaadb1fdcb@aklaver.com> (raw)
In-Reply-To: <88EF58F000EC4B4684700C2AA3A73D7A082D27F19C07@W2008DC01.ColliniConsulting.lan>
References: <88EF58F000EC4B4684700C2AA3A73D7A082D27F19C04@W2008DC01.ColliniConsulting.lan>
	<88EF58F000EC4B4684700C2AA3A73D7A082D27F19C06@W2008DC01.ColliniConsulting.lan>
	<c970db21-1ab7-13b5-0290-0a36aca7119f@aklaver.com>
	<88EF58F000EC4B4684700C2AA3A73D7A082D27F19C07@W2008DC01.ColliniConsulting.lan>

On 6/21/19 1:40 AM, Job wrote:
> Dear Adrian,
> 
> thank you for the reply!
> 
>>> i am struggling with a problem due, sometime, to a double concurrent update on the same row of a table.
> 
>> What is the error message you get?
> 
> We have no error, but the two queries, in "Lock wait", keep stucked for some minutes before completed.
> Are there any parameters useful to "serialize" in some way two different Update queries - for the same field in the same row - arriving concurrently?
> 
> I was looking at the lock_timeout parameter: could it be what i am looking for?

If I understood your OP you do not have control of what the client, 
correct? If that is the case it makes what you want to achieve more 
difficult. To understand what can be done you will want to take a look at:

The locking choices in Postgres.
https://www.postgresql.org/docs/11/mvcc.html

The lock timeouts available(though I don't think they apply to your case)
https://www.postgresql.org/docs/11/runtime-config-locks.html

How to change the transaction modes
https://www.postgresql.org/docs/11/sql-set-transaction.html

> 
> Thank you!
> Franco
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (2+ messages)

Message-ID: <e09f4726-14e6-2d65-4765-35aaadb1fdcb@aklaver.com>
Permalink:  ../e09f4726-14e6-2d65-4765-35aaadb1fdcb@aklaver.com/
Also on:    postgresql.org/message-id/e09f4726-14e6-2d65-4765-35aaadb1fdcb@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, Job@colliniconsulting.com
  Subject: Re: R: Problem with row-level lock
  In-Reply-To: <e09f4726-14e6-2d65-4765-35aaadb1fdcb@aklaver.com>
  References: <88EF58F000EC4B4684700C2AA3A73D7A082D27F19C04@W2008DC01.ColliniConsulting.lan> <88EF58F000EC4B4684700C2AA3A73D7A082D27F19C06@W2008DC01.ColliniConsulting.lan> <c970db21-1ab7-13b5-0290-0a36aca7119f@aklaver.com> <88EF58F000EC4B4684700C2AA3A73D7A082D27F19C07@W2008DC01.ColliniConsulting.lan> <e09f4726-14e6-2d65-4765-35aaadb1fdcb@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox