Обсуждение: PostgreSQL PITR - more doubts

От:
Jayadevan M
Дата:

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 </dev/null'
I took a base backup last night. If I try to recover the server today
after
copying the base backup from yesterday and providing
restore_command = 'cp /home/postgres/archive/%f %p'
does PostgreSQL go through all the past week's archived WALS or
it can figure out that the base backup is from yesterday, so skip
a large number of archived WALs and start only from file xxx ?
Either way, are there ways to speed up the restore process?
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."






От:
Jesper Krogh
Дата:

On 2010-07-12 13:23, Jayadevan M wrote:
> 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</dev/null'
> I took a base backup last night. If I try to recover the server today
> after
> copying the base backup from yesterday and providing
> restore_command = 'cp /home/postgres/archive/%f %p'
> does PostgreSQL go through all the past week's archived WALS or
> it can figure out that the base backup is from yesterday, so skip
> a large number of archived WALs and start only from file xxx ?
>

Yes, It starts out form "where it needs to". Assuming you
did a pg_start_backup() before you did your base backup?

--
Jesper

От:
Jayadevan M
Дата:

> Yes, It starts out form "where it needs to". Assuming you
>did a pg_start_backup() before you did your base backup?

Thanks. I did.
It uses files like 0000000B00000000000000D9.00000020.backupto get the
necessary information?

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."






От:
"Kevin Grittner"
Дата:

Jayadevan M <> wrote:

>> Yes, It starts out form "where it needs to". Assuming you
>> did a pg_start_backup() before you did your base backup?
>
> Thanks. I did.
> It uses files like 0000000B00000000000000D9.00000020.backupto get
> the necessary information?

Yeah, since it's a text file, you can easily have a look at what is
stored there.  It's based on when pg_start_backup and pg_stop_backup
were run.

-Kevin