Re: View deleted records in a table

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Boyan Botev <bbotev(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: View deleted records in a table
Date: 2016-03-26 17:32:45
Message-ID: CANu8Fiw7XX5djLVdOxEtt6zBbAviO31pQhMEbOiz3PsnfNy5Vg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Mar 26, 2016 at 12:23 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 03/26/2016 09:08 AM, Boyan Botev wrote:
>
>> I want to view deleted records in table from a week ago in order to
>> troubleshoot a data issue. The table has not been vacuumed yet. I was
>>
>
> Are you sure?
> In other words do you have autovacuum turned off?
>
> trying to use the pageinspect v1.4 extension but can't seem to convert
>> the t_data to a readable record. Is there an easy way for me to get a
>>
>
> What is t_data?
>
> What version of Postgres?
>
> SQL to produce all system columns like xmin, xmax along with the visible
>> and invisible records of the table in a readable form.
>>
>> I was hoping to find a setting similar to what Netezza has "set
>> show_deleted_records=1;" to easily turn this visibility on or off, but
>> it seems that feature was shot down several years ago. As a DBA I want
>> to say that a feature like this is indispensible when troubleshooting
>> data problems in large tables and environments where restores may not
>> always be an option.
>>
>
> That means keeping deleted records around for some indefinite period of
> time, which means table bloat.
>
>
>> Thanks in advance for any help,
>> Boyan
>>
>>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

>I want to view deleted records in table from a week ago i
The accepted method for handling deleted (or updated) records is to create
a TRIGGER (or RULE) on the table(s) that writes the record to a history
file after it has been deleted (or updated).

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Boyan Botev 2016-03-26 17:32:59 Re: View deleted records in a table
Previous Message Adrian Klaver 2016-03-26 16:23:41 Re: View deleted records in a table