Re: Queries getting older values (autocommit enabled)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Eudald Valcàrcel Lacasa <eudald(dot)valcarcel(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Queries getting older values (autocommit enabled)
Date: 2020-04-24 16:15:28
Message-ID: 4391.1587744928@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?UTF-8?Q?Eudald_Valc=C3=A0rcel_Lacasa?= <eudald(dot)valcarcel(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Eudald Valcàrcel Lacasa 2020-04-24 16:30:14 Re: Queries getting older values (autocommit enabled)
Previous Message PG Bug reporting form 2020-04-24 16:13:25 BUG #16387: postgres12-* packages not in yum repo