Re: Queries getting older values (autocommit enabled) - Mailing list pgsql-bugs

From Eudald Valcàrcel Lacasa
Subject Re: Queries getting older values (autocommit enabled)
Date
Msg-id CANEx+AVS4a7PYUV3ERfcfipqY_=Yz6y3tP1U0RE6n4Pe=eQS3w@mail.gmail.com
Whole thread Raw
In response to Re: Queries getting older values (autocommit enabled)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Queries getting older values (autocommit enabled)
List pgsql-bugs
Hello!
Thanks David and Tom for your answer.
I'll check out mvcc. Would user defined locks on a specific table make PostgreSql underperform too much?

Thanks again,
Eudald

El vie., 24 abr. 2020 a las 18:15, Tom Lane (<tgl@sss.pgh.pa.us>) escribió:
Eudald Valcàrcel Lacasa <eudald.valcarcel@gmail.com> writes:
> Could it be possible that, somehow, the select query starts before the
> update one, although it's printed as if it's being executed after it?

It's certainly possible that the select is using a snapshot that was
taken before the update commits.  You should read this chapter of
the manual for background and some hints:

https://www.postgresql.org/docs/current/mvcc.html

                        regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Queries getting older values (autocommit enabled)
Next
From: cbw
Date:
Subject: Re: Backend stuck in tirigger.c:afterTriggerInvokeEvents forever