From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Yotsunaga, Naoki <yotsunaga.naoki@jp.fujitsu.com>
To: Postgres hackers <pgsql-hackers@postgresql.org>
Subject: Re: automatic restore point
Date: Fri, 28 Sep 2018 21:13:17 +0200
Message-ID: <d6ca5c16-ab9c-658d-2b4a-618f970ce4b2@2ndquadrant.com> (raw)
In-Reply-To: <8E9126CB6CE2CD42962059AB0FBF7B0DC2C712@g01jpexmbkw23>
References: <8E9126CB6CE2CD42962059AB0FBF7B0DBE3167@g01jpexmbkw23>
<8E9126CB6CE2CD42962059AB0FBF7B0DC2592A@g01jpexmbkw23>
<8E9126CB6CE2CD42962059AB0FBF7B0DC2C712@g01jpexmbkw23>
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 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
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, yotsunaga.naoki@jp.fujitsu.com
Subject: Re: automatic restore point
In-Reply-To: <d6ca5c16-ab9c-658d-2b4a-618f970ce4b2@2ndquadrant.com>
* 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