Re: [GENERAL] Restore postgres to specific time

2012-11-27 Thread Jeff Janes
On Tue, Nov 27, 2012 at 6:59 AM, Kevin Grittner wrote: > wd wrote: > >> the time is between backup start and stop. > > That is the problem -- until the point where pg_stop_backup() was > run PostgreSQL can't be sure of having a consistent database. In 9.2, it seems to be willing to give it a shot

Re: [GENERAL] Restore postgres to specific time

2012-11-27 Thread Jeff Janes
On Tue, Nov 27, 2012 at 6:59 AM, Kevin Grittner wrote: > wd wrote: > >> the time is between backup start and stop. > > That is the problem -- until the point where pg_stop_backup() was > run PostgreSQL can't be sure of having a consistent database. It is > waiting from enough WAL to get it there.

Re: [GENERAL] Restore postgres to specific time

2012-11-27 Thread Tom Lane
"Kevin Grittner" writes: > That is the problem -- until the point where pg_stop_backup() was > run PostgreSQL can't be sure of having a consistent database. It is > waiting from enough WAL to get it there. My practice is always to > keep the last two base backups and all WAL from the start of the

Re: [GENERAL] Restore postgres to specific time

2012-11-27 Thread Kevin Grittner
wd wrote: > the time is between backup start and stop. That is the problem -- until the point where pg_stop_backup() was run PostgreSQL can't be sure of having a consistent database. It is waiting from enough WAL to get it there. My practice is always to keep the last two base backups and all WAL

Re: [GENERAL] Restore postgres to specific time

2012-11-26 Thread wd
On Tue, Nov 27, 2012 at 8:27 AM, Jeff Janes wrote: > On Mon, Nov 26, 2012 at 12:23 PM, Kevin Grittner wrote: > > Jeff Janes wrote: > > > >> FATAL: requested recovery stop point is before consistent recovery point > >> > >> I don't understand why are you not getting this message. > > > > Is it be

Re: [GENERAL] Restore postgres to specific time

2012-11-26 Thread wd
On Mon, Nov 26, 2012 at 11:32 PM, Albe Laurenz wrote: > wd wrote: > >>> Logs are something like this: > >>> > >>> [2012-11-24 21:51:33.591 CST 583 50b0d0e5.247 9 0]LOG: recovery > has paused > >>> [2012-11-24 21:51:33.591 CST 583 50b0d0e5.247 10 0]HINT: > Execute pg_xlog_replay_resume() t

Re: [GENERAL] Restore postgres to specific time

2012-11-26 Thread Jeff Janes
On Mon, Nov 26, 2012 at 12:23 PM, Kevin Grittner wrote: > Jeff Janes wrote: > >> FATAL: requested recovery stop point is before consistent recovery point >> >> I don't understand why are you not getting this message. > > Is it before the point where pg_stop_backup() was run? It turns out that the

Re: [GENERAL] Restore postgres to specific time

2012-11-26 Thread Kevin Grittner
Jeff Janes wrote: > FATAL: requested recovery stop point is before consistent recovery point > > I don't understand why are you not getting this message. Is it before the point where pg_stop_backup() was run? -Kevin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To mak

Re: [GENERAL] Restore postgres to specific time

2012-11-26 Thread Jeff Janes
On Sat, Nov 24, 2012 at 3:44 PM, wd wrote: >> >> What entries are you getting in the log file? >> > Logs are something like this: > > [2012-11-24 21:51:33.374 CST 583 50b0d0e5.247 1 0]LOG: database system > was shut down in recovery at 2012-11-24 21:51:32 CST > [2012-11-24 21:51:33.375 CS

Re: [GENERAL] Restore postgres to specific time

2012-11-26 Thread Albe Laurenz
wd wrote: >>> Logs are something like this: >>> >>> [2012-11-24 21:51:33.591 CST 583 50b0d0e5.247 9 0]LOG: recovery has paused >>> [2012-11-24 21:51:33.591 CST 583 50b0d0e5.247 10 0]HINT: Execute pg_xlog_replay_resume() to continue. >> >> Well, try >> >> SELECT pg_xlog_replay_resume();

Re: [GENERAL] Restore postgres to specific time

2012-11-26 Thread wd
I can't connect to postgres at that time. On Mon, Nov 26, 2012 at 4:33 PM, Albe Laurenz wrote: > wd wrote: > > Logs are something like this: > > [2012-11-24 21:51:33.591 CST 583 50b0d0e5.247 9 0]LOG: recovery > has paused > > [2012-11-24 21:51:33.591 CST 583 50b0d0e5.247 10 0]HINT: Exe

Re: [GENERAL] Restore postgres to specific time

2012-11-26 Thread Albe Laurenz
wd wrote: > Logs are something like this: > [2012-11-24 21:51:33.591 CST 583 50b0d0e5.247 9 0]LOG: recovery has paused > [2012-11-24 21:51:33.591 CST 583 50b0d0e5.247 10 0]HINT: Execute pg_xlog_replay_resume() to continue. Well, try SELECT pg_xlog_replay_resume(); Yours, Laurenz Albe

Re: [GENERAL] Restore postgres to specific time

2012-11-24 Thread wd
On Sun, Nov 25, 2012 at 4:25 AM, Jeff Janes wrote: > On Sat, Nov 24, 2012 at 6:00 AM, wd wrote: > > Yes, you are right, after set the two command, the recovery will stop at > > that time. > > > > But there is an other question, how to make this recovered Postgres can > be > > read and write? Ac

Re: [GENERAL] Restore postgres to specific time

2012-11-24 Thread Jeff Janes
On Sat, Nov 24, 2012 at 6:00 AM, wd wrote: > Yes, you are right, after set the two command, the recovery will stop at > that time. > > But there is an other question, how to make this recovered Postgres can be > read and write? According to the manual, Postgres should be rename > recovery.conf to

Re: [GENERAL] Restore postgres to specific time

2012-11-24 Thread wd
Yes, you are right, after set the two command, the recovery will stop at that time. But there is an other question, how to make this recovered Postgres can be read and write? According to the manual, Postgres should be rename recovery.conf to recovery.done, but it didn't. I've tried pg_ctl promo

Re: [GENERAL] Restore postgres to specific time

2012-11-23 Thread Jeff Janes
On Thu, Nov 22, 2012 at 7:29 PM, wd wrote: > Thanks for your reply, the logs are something like bellow,postgres will > restore every wal log I put in the xlog directory,and then continues waiting > for next wal log. The postgres version is 9.1.6. > > [2012-11-22 18:49:24.175 CST 25744 50ae0334

Re: [GENERAL] Restore postgres to specific time

2012-11-23 Thread Albe Laurenz
wd wrote: >>> I've try to restore Postgres to a specific time but failed. >>> >>> The recovery.conf as bellow >>> restore_command='cp /t/xlog/%f %p' >>> recovery_target_time='2012-11-22 5:01:09 CST' >>> pause_at_recovery_target=true >>> recovery_target_inclusive=false >>> >>> The basebackup was mad

Re: [GENERAL] Restore postgres to specific time

2012-11-23 Thread raghu ram
On Fri, Nov 23, 2012 at 8:59 AM, wd wrote: > Thanks for your reply, the logs are something like bellow,postgres will > restore every wal log I put in the xlog directory,and then continues > waiting for next wal log. The postgres version is 9.1.6. > > [2012-11-22 18:49:24.175 CST 25744 50ae033

Re: [GENERAL] Restore postgres to specific time

2012-11-22 Thread wd
Thanks for your reply, the logs are something like bellow,postgres will restore every wal log I put in the xlog directory,and then continues waiting for next wal log. The postgres version is 9.1.6. [2012-11-22 18:49:24.175 CST 25744 50ae0334.6490 1 0]LOG: database system was shut down in reco

Re: [GENERAL] Restore postgres to specific time

2012-11-22 Thread Albe Laurenz
wd wrote: > I've try to restore Postgres to a specific time but failed. > > The recovery.conf as bellow > restore_command='cp /t/xlog/%f %p' > recovery_target_time='2012-11-22 5:01:09 CST' > pause_at_recovery_target=true > recovery_target_inclusive=false > > The basebackup was made at 2012-11-22