pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Subject: Re: generated columns bug, see inconsistent data
Date: Tue, 25 Oct 2022 21:35:00 -0400
Message-ID: <144386.1666748100@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMkU=1xBMZ1-qq3+ef-j75g-X2JN+cZdDm_pGou9gceBvhqe_w@mail.gmail.com>
References: <CAMkU=1xBMZ1-qq3+ef-j75g-X2JN+cZdDm_pGou9gceBvhqe_w@mail.gmail.com>

Jeff Janes <jeff.janes@gmail.com> writes:
> I can reproduce the issue in all recent versions (didn't check before 12),
> including 15.0 and 16dev.  You can see rows in which the generated column
> has a value inconsistent with the columns it is generated from.

My first guess about this is that we're failing to recalculate generated
columns in the EPQ code path where an update is re-applied to a
just-modified row.  Can you tell whether the inconsistencies are
associated with rows that get updated twice in quick succession (by
different sessions)?  Does the problem go away under serializable mode?

> If I copy the core expression of the immutable function into the generated
> column expression, leaving the function just for the monitoring query, then
> I never see the inconsistency.

Maybe that changes the timing?

			regards, tom lane





view thread (2+ messages)

Message-ID: <144386.1666748100@sss.pgh.pa.us>
Permalink:  ../144386.1666748100@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/144386.1666748100@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jeff.janes@gmail.com, pgsql-bugs@lists.postgresql.org, peter.eisentraut@enterprisedb.com
  Subject: Re: generated columns bug, see inconsistent data
  In-Reply-To: <144386.1666748100@sss.pgh.pa.us>

* 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