pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Alexander Kass <alexander.kass@jetbrains.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: No xmin in pg_database
Date: Thu, 02 Sep 2021 10:53:06 +0200
Message-ID: <0cea1cb2929da04dc46a2fb198a7b54dc260cc17.camel@cybertec.at> (raw)
In-Reply-To: <CAPhX7d2NnttM+0R=NiRas+s-RTX696zUZwP-hM6BEo9vKpUHfQ@mail.gmail.com>
References: <CAPhX7d2NnttM+0R=NiRas+s-RTX696zUZwP-hM6BEo9vKpUHfQ@mail.gmail.com>

On Thu, 2021-09-02 at 08:50 +0300, Alexander Kass wrote:
> Hi! I'm Alexander from DataGrip.
> We actively use xmin's from pg_catalog tables to incrementally
> synchronize our database model.
> We have a small number of users that do not have xmin in pg_database
> (we've asked them to try `select xmin from pg_database` and got
> `column xmin does not exist`).
> There is an old ticket https://youtrack.jetbrains.com/issue/DBE-7588
> (at that time there was no real need in that xmin so we just removed
> it)
> Now xmins are back and so are the problems.
> The most recent report is about version `PostgreSQL 12.4 (Ubuntu
> 12.4-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
> 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit`
> 
> How can that happen that there is no xmin in pg_database?
> Is it a normal behaviour and that is configurable? Or is this a kind
> of data corruption?
> Can that happen to other tables?
> 
> I haven't been able to find answers myself, so I'm asking for help :)
> Thanks in advance

All PostgreSQL tables have "xmin", and all catalog tables do as well.

If you use a non-standard table access method, a table might not
have "xmin".  But that cannot apply to catalog tables.

Perhaps that was not really PostgreSQL, but some fork where the
persistence layer was modified?

I am not sure if it is a good idea to rely on "xmin" at all.  These
numbers are recycled when transaction IDs wrap around, and you could
have two entries with the same "xmin" that have a totally different
meaning, because one of the rows is frozen and the other isn't.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (7+ messages)  latest in thread

Message-ID: <0cea1cb2929da04dc46a2fb198a7b54dc260cc17.camel@cybertec.at>
Permalink:  ../0cea1cb2929da04dc46a2fb198a7b54dc260cc17.camel@cybertec.at/
Also on:    postgresql.org/message-id/0cea1cb2929da04dc46a2fb198a7b54dc260cc17.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, alexander.kass@jetbrains.com
  Subject: Re: No xmin in pg_database
  In-Reply-To: <0cea1cb2929da04dc46a2fb198a7b54dc260cc17.camel@cybertec.at>
  References: <CAPhX7d2NnttM+0R=NiRas+s-RTX696zUZwP-hM6BEo9vKpUHfQ@mail.gmail.com> <0cea1cb2929da04dc46a2fb198a7b54dc260cc17.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