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 CABzZFEsXGhBr_nef+jgE6rbFGrE-knG+xQhZOCzgyX9_bt3+5w@mail.gmail.com
Whole thread Raw
In response to Re: Archiving and recovering pg_stat_tmp  (Sameer Thakur <samthakur74@gmail.com>)
Responses Re: Archiving and recovering pg_stat_tmp  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-general
>>But, if you do PITR using the same directory (which I haven't), I
>>think you would need to somehow replace the stats with the ones you
>>want, may be from your backup of the same (that is, of
>>pg_stat/*.stat), though I am not sure if that would be correct. I
>>doubt if WAL replay (as in a consistent recovery mechanism :-) )
>>accounts for the stats. I guess stats are not WAL logged (like changes
>>to table data) since they are managed using temporary files in
>>pg_stat_temp and hence may not be recoverable using WAL replay to a
>>particular state using PITR. but I may be wrong.
>>Thoughts?
> I agree. Will try PITR with stats file from different timeline and confirm this

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

Thoughts?
regards
Sameer






pgsql-general by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: .pgpass being ignored
Next
From: Bruce Momjian
Date:
Subject: Re: PostgreSQL 9.1.10 release date?