Re: Archiving and recovering pg_stat_tmp

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Sameer Thakur <samthakur74(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 16:20:17
Message-ID: CA+HiwqFSMSHpvAfdyy6EYg049tkaQXXv_5=8n-oDy_s3ecLLdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 25, 2013 at 11:32 PM, Sameer Thakur <samthakur74(at)gmail(dot)com> wrote:
>>>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
>

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?

--
Amit Langote

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Atri Sharma 2013-06-25 17:19:11 Re: Data Minning and analisys tool for Postgres?
Previous Message Dmitriy Igrishin 2013-06-25 16:04:44 Re: [HACKERS] Frontend/backend protocol improvements proposal (request).