Re: Archiving and recovering pg_stat_tmp - Mailing list pgsql-general

From Sameer Thakur
Subject Re: Archiving and recovering pg_stat_tmp
Date
Msg-id CABzZFEsUwwJBOtU3FAEALHVg1ADbAcq_ko6fD8SGUdwkKnafUQ@mail.gmail.com
Whole thread Raw
In response to Re: Archiving and recovering pg_stat_tmp  (Amit Langote <amitlangote09@gmail.com>)
List 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


pgsql-general by date:

Previous
From: Dan Birken
Date:
Subject: Re: pg_receivexlog 9.2 client working with 9.1 server?
Next
From: Adarsh Sharma
Date:
Subject: Concatenate table name in Pl/Pgsql