Re: Archiving and recovering pg_stat_tmp

From: Sameer Thakur <samthakur74(at)gmail(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Archiving and recovering pg_stat_tmp
Date: 2013-06-26 04:41:51
Message-ID: CABzZFEsUwwJBOtU3FAEALHVg1ADbAcq_ko6fD8SGUdwkKnafUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> >
> > I did the following
> > 1. Enabled archiving
> > 2. Executed SQL's 3. Shutdown 4. copied data directory (including the
> > pgstats.stat under global) and archive directory under backup/1
> > repeated 2,3,4 once more
> > So now i have 2 backup directories.
> > Now i created recovery.conf under backup/1/data. It has recovery command
> > copying from backup1 archive.
> > Next i renamed pagstat.stat under backup1/data/global as pgstat_1.stat.
> > Next i copied pgstat.stat from backup 2 into backup 1 (under the usual
> > global directory).
> > Pointed the server to backup1 data directory and started it.
> Surprisingly it
> > works with no complaints about wrong pgstat.stats
> >
>
> >Do you have only one archive set up? What do you mean when you mention
> >"backup1" archive?

>What kind of complaints did you see when you did in past? I am not
> >aware of such errors; am I missing some?
>

I am sorry for being unclear. directories are
/backup1/data
/backup1/archive
and
/backup2/data
/backup2/archive

backup1 has data and archive directories copied after 1st shutdown
backup2 has data and archive directories copied after 2nd shutdown

Now i created recovery.conf in backup1/data and i replaced pgstats.stat
from backup2 in backup1 (in data/global)
Now i start Server pointing to backup1, where it uses recovery.conf to
rollback to database snapshot after first shutdown

I expected a failure because pgstats.stat do not reflect statistics of
snapshot created from backup1 directory (1st shutdown) but of backup2 (2nd
shutdown)

regards
Sameer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adarsh Sharma 2013-06-26 05:07:29 Concatenate table name in Pl/Pgsql
Previous Message Dan Birken 2013-06-26 02:26:41 Re: pg_receivexlog 9.2 client working with 9.1 server?