Re: Using xmax to detect deleted rows

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Meel Velliste <meel(dot)velliste(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using xmax to detect deleted rows
Date: 2016-01-08 15:02:09
Message-ID: 20160108150209.GA583343@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Meel Velliste wrote:
> I would like to use the "xmax" column to detect rows that have been
> recently deleted. Is it possible to get the deleted row versions with
> non-zero xmax to remain visible long enough that I could periodically
> check, say once an hour, and still be able to see rows that were deleted
> since I last checked?

No. Maybe you want a trigger that saves the deleted row somewhere (a
separate table perhaps) which you can later inspect and delete again?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Deven Phillips 2016-01-08 15:04:38 PostgreSQL 9.5, mysql_fdw, and IMPORT FOREIGN SCHEMA question
Previous Message Henning Hoefer 2016-01-08 14:12:11 Packages for Ubuntu Wily