help:how to rollback postgresql to several minutes ago

Started by 刘剑about 10 years ago3 messagesbugs
Jump to latest
#1刘剑
liujian@raintai.com

hello

please help,

I had written an update sql without where condition to my table, then updated whole table.
So how can i rollback this?

thank you very much.

#2Michael Paquier
michael@paquier.xyz
In reply to: 刘剑 (#1)
Re: help:how to rollback postgresql to several minutes ago

On Thu, Apr 14, 2016 at 7:06 PM, 刘剑 <liujian@raintai.com> wrote:

I had written an update sql without where condition to my table, then
updated whole table.
So how can i rollback this?

You need to roll in a backup I am afraid, and you should always have
some. Postgres has no way to replay back directly WAL records, it can
only forward replay. In such circumstances standby nodes with a delay
when applying WAL are useful.
--
Michael

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#3Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#2)
Re: help:how to rollback postgresql to several minutes ago

On Thu, Apr 14, 2016 at 9:23 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

On Thu, Apr 14, 2016 at 7:06 PM, 刘剑 <liujian@raintai.com> wrote:

I had written an update sql without where condition to my table, then
updated whole table.
So how can i rollback this?

You need to roll in a backup I am afraid, and you should always have
some. Postgres has no way to replay back directly WAL records, it can
only forward replay. In such circumstances standby nodes with a delay
when applying WAL are useful.

By the way, this is not a bug. Such basic questions had better be
asked on pgsql-novice.
--
Michael

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs