Re: automatic restore point - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: automatic restore point
Date
Msg-id d6ca5c16-ab9c-658d-2b4a-618f970ce4b2@2ndquadrant.com
Whole thread Raw
In response to RE: automatic restore point  ("Yotsunaga, Naoki" <yotsunaga.naoki@jp.fujitsu.com>)
Responses Re: automatic restore point  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On 06/09/2018 02:16, Yotsunaga, Naoki wrote:
> -----Original Message-----
> From: Yotsunaga, Naoki [mailto:yotsunaga.naoki@jp.fujitsu.com] 
> Sent: Tuesday, June 26, 2018 10:18 AM
> To: Postgres hackers <pgsql-hackers@postgresql.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
accidentallyerasing 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


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: ALTER TABLE on system catalogs
Next
From: Andres Freund
Date:
Subject: Re: ALTER TABLE on system catalogs