Re: automatic restore point

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: "Yotsunaga, Naoki" <yotsunaga(dot)naoki(at)jp(dot)fujitsu(dot)com>, 'Postgres hackers' <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: automatic restore point
Date: 2018-09-28 19:13:17
Message-ID: d6ca5c16-ab9c-658d-2b4a-618f970ce4b2@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06/09/2018 02:16, Yotsunaga, Naoki wrote:
> -----Original Message-----
> From: Yotsunaga, Naoki [mailto:yotsunaga(dot)naoki(at)jp(dot)fujitsu(dot)com]
> Sent: Tuesday, June 26, 2018 10:18 AM
> To: Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
> Subject: automatic restore point
>
>> Hi, I attached a patch to output the LSN before execution to the server log >when executing a specific command and accidentally erasing data.
>
> Since there was an error in the attached patch, I attached the modified patch.

I think this should be done using event triggers. Right now, you just
have it hardcoded to TRUNCATE and DROP TABLE, which seems somewhat
arbitrary. With event triggers, you have the full flexibility to do
what you want. You can pick which commands to apply it to, you can log
the LSN, you can create restore points, etc.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-09-28 19:15:03 Re: ALTER TABLE on system catalogs
Previous Message Alvaro Herrera 2018-09-28 19:06:30 Re: ALTER TABLE on system catalogs