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-25 14:32:38
Message-ID: CABzZFEsXGhBr_nef+jgE6rbFGrE-knG+xQhZOCzgyX9_bt3+5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

>>
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2013-06-25 15:11:36 Re: PostgreSQL 9.1.10 release date?
Previous Message Magnus Hagander 2013-06-25 14:13:56 Re: .pgpass being ignored