Queries about PostgreSQL PITR

Поиск
Список
Период
Сортировка
Искать

Queries about PostgreSQL PITR

От:
Jayadevan M <Jayadevan.Maymala@ibsplc.com>
Дата:
Hello all,

I am learning PostgreSQL PITR. I have PostgreSQL running with the 
following parameters 
set up for archiving/log switching:

archive_mode = on 
archive_command = 'cp -i %p /home/postgres/archive/%f 

Re: Queries about PostgreSQL PITR

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Fri, Jul 9, 2010 at 6:47 PM, Jayadevan M
 wrote:
> So recovery happened to a point after I dropped the first table and before
> I dropped
> the second table. Why ?

Because you didn't disable recovery_target_inclusive, I guess.
http://www.postgresql.org/docs/8.4/static/continuous-archiving.html#RECOVERY-TARGET-INCLUSIVE

> Is there a way in which I can now go back a bit further, and ensure I am
> back to the
> time line before I dropped either of the tables? From documentation, I
> think the answer is 'No'.
> Of course, I could try the entire recovery process once more, and provide
> a couple of minutes
> earlier time as recovery_target_time.

How about setting recovery_target_timeline to the old timeline ID (= 1)?
http://www.postgresql.org/docs/8.4/static/continuous-archiving.html#RECOVERY-TARGET-TIMELINE

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Re: Queries about PostgreSQL PITR

От:
Jayadevan M <Jayadevan.Maymala@ibsplc.com>
Дата:
Hi,
>Because you didn't disable recovery_target_inclusive, I guess.
>
http://www.postgresql.org/docs/8.4/static/continuous-archiving.html#RECOVERY-TARGET-INCLUSIVE
Thanks. I was almost sure this will fix it. But the issue seems to be 
something else. Even if I give a time that is a few more minutes before 
what I got from select now(), it is always moving upto/or just before 
(depending on the above parameter) transaction id 676. The ooutput reads 
 LOG:  recovery stopping before commit of transaction 676, time 2010-07-09 
07:49:26.580518+05:30

Is there a way to find out the transaction ids and corresponding SQLs, 
timeline etc? May be doing the recovery in debug/logging mode or something 
like that?

Regards,
Jayadevan





DISCLAIMER: 

"The information in this e-mail and any attachment is intended only for 
the person to whom it is addressed and may contain confidential and/or 
privileged material. If you have received this e-mail in error, kindly 
contact the sender and destroy all copies of the original communication. 
IBS makes no warranty, express or implied, nor guarantees the accuracy, 
adequacy or completeness of the information contained in this email or any 
attachment and is not liable for any errors, defects, omissions, viruses 
or for resultant loss or damage, if any, direct or indirect."





Re: Queries about PostgreSQL PITR

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Mon, Jul 12, 2010 at 5:29 PM, Jayadevan M
 wrote:
> Hi,
>>Because you didn't disable recovery_target_inclusive, I guess.
>>
> http://www.postgresql.org/docs/8.4/static/continuous-archiving.html#RECOVERY-TARGET-INCLUSIVE
> Thanks. I was almost sure this will fix it. But the issue seems to be
> something else. Even if I give a time that is a few more minutes before
> what I got from select now(), it is always moving upto/or just before
> (depending on the above parameter) transaction id 676. The ooutput reads
>  LOG:  recovery stopping before commit of transaction 676, time 2010-07-09
> 07:49:26.580518+05:30

A recovery stops when the commit time > or >= recovery_target_time.
So, unless it moves up to the newer commit than recovery_target_time,
it cannot stop.

> Is there a way to find out the transaction ids and corresponding SQLs,
> timeline etc? May be doing the recovery in debug/logging mode or something
> like that?

xlogviewer reads WAL files and displays the contents of them. But
it's been inactive for several years, so I'm not sure if it's available now.
http://pgfoundry.org/projects/xlogviewer/

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

PostgreSQL PITR - more doubts

От:
Jayadevan M <Jayadevan.Maymala@ibsplc.com>
Дата:
Hello all,
One doubt about how PostgreSQL PITR works. Let us say I have all the 
archived WALs for the past week with 
archive_command = 'cp -i %p /home/postgres/archive/%f 
FAQ