pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Guillaume Lelarge <guillaume@lelarge.info>
To: Luca Ferrari <fluca1978@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: xmax not zero?
Date: Mon, 30 Oct 2023 14:24:45 +0100
Message-ID: <b8e727ca85abb6e36a946c39cd4b1789110390d4.camel@cybertec.at> (raw)
In-Reply-To: <CAECtzeX0rdhG42jR0R+j4ytQgP4SRUXKrLX26rO7poqoR2e=mg@mail.gmail.com>
References: <CAKoxK+4OkBvHteiK9ws=G5G2L5w_2QcR5+=XDzKUP6PN7JmrYw@mail.gmail.com>
	<CAECtzeX0rdhG42jR0R+j4ytQgP4SRUXKrLX26rO7poqoR2e=mg@mail.gmail.com>

On Mon, 2023-10-30 at 13:53 +0100, Guillaume Lelarge wrote:
> Le lun. 30 oct. 2023 à 13:45, Luca Ferrari <fluca1978@gmail.com> a écrit :
> > I have a table that presents an xmax not zeroed outside of a
> > transaction block, and it does not look normal to me.
> > I have no idea about how this happened, it is one of my "toy"
> > PostgreSQL virtual machines.
> > But how to dig an better understand why there is an xmax with a non-zero value?
> 
> There are many reasons for a non-zero value: row updated or deleted in a rollbacked
> transaction, row updated or deleted in a current transaction, row locked by a
> SELECT FOR UPDATE, and perhaps others I don't remember right now.

INSERT ... ON CONFLICT could also cause this.
As long as the transaction corresponding to the "xid" is marked as "aborted",
that number is not valid and is treated like a 0.

Yours,
Laurenz Albe





view thread (5+ messages)  latest in thread

Message-ID: <b8e727ca85abb6e36a946c39cd4b1789110390d4.camel@cybertec.at>
Permalink:  ../b8e727ca85abb6e36a946c39cd4b1789110390d4.camel@cybertec.at/
Also on:    postgresql.org/message-id/b8e727ca85abb6e36a946c39cd4b1789110390d4.camel@cybertec.at

 · 

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: laurenz.albe@cybertec.at, guillaume@lelarge.info, fluca1978@gmail.com
  Subject: Re: xmax not zero?
  In-Reply-To: <b8e727ca85abb6e36a946c39cd4b1789110390d4.camel@cybertec.at>
  References: <CAKoxK+4OkBvHteiK9ws=G5G2L5w_2QcR5+=XDzKUP6PN7JmrYw@mail.gmail.com> <CAECtzeX0rdhG42jR0R+j4ytQgP4SRUXKrLX26rO7poqoR2e=mg@mail.gmail.com> <b8e727ca85abb6e36a946c39cd4b1789110390d4.camel@cybertec.at>

* 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