pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Lionel Bouton <lionel.bouton@jtek.fr>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Reconstructing transaction content after the fact
Date: Wed, 02 Sep 2020 12:50:18 -0400
Message-ID: <338420.1599065418@sss.pgh.pa.us> (raw)
In-Reply-To: <091ea8f4-1530-40b7-ff01-56576903a4b1@jtek.fr>
References: <091ea8f4-1530-40b7-ff01-56576903a4b1@jtek.fr>

Lionel Bouton <lionel.bouton@jtek.fr> writes:
> Are txids in table file data indeed a means by which you can recover the
> data written by a single transaction (assuming the txids don't overflow
> the 32bit limit during the life of the cluster) ?

They are.  You could reduce the connections between different rows by
writing them in different subtransactions of the parent transaction
(use SAVEPOINT/RELEASE SAVEPOINT, or exception blocks in plpgsql).
But unless there's many parallel transactions writing data, somebody
could probably still reconstruct things by assuming that nearby XIDs
represent subtransactions of a single transaction.

> Are these t_xmin values ever cleaned up (by VACUUM or another mechanism)
> ? If positive is there a way to configure the approximate time during
> which these values can be recovered ?

See VACUUM FREEZE.  You couldn't hide connections immediately after
insertion, but if the idea is to sanitize every so often, it'd help.

> Is there a way to access these values by connecting to a PostgreSQL
> server instead of analyzing in-memory or on-disk data ?

SELECT xmin, ... FROM votes;

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <338420.1599065418@sss.pgh.pa.us>
Permalink:  ../338420.1599065418@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/338420.1599065418@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 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: tgl@sss.pgh.pa.us, lionel.bouton@jtek.fr
  Subject: Re: Reconstructing transaction content after the fact
  In-Reply-To: <338420.1599065418@sss.pgh.pa.us>
  References: <091ea8f4-1530-40b7-ff01-56576903a4b1@jtek.fr> <338420.1599065418@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