pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Roland <david.roland@soapware.com>
To: Ian Lea <ian.lea@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_start_backup - backups
Date: Fri, 8 Apr 2011 13:29:07 -0500
Message-ID: <7E0E9F0DF4C17A40BE6F616E6492B4D353E507@ExchangeVM.DOCS.COM> (raw)
References: <1302200280041-4289135.post@n5.nabble.com>
	<BANLkTik2vMyXb7EyeQLVUW8waAKDBaU4rA@mail.gmail.com>

First of all, thanks so much for the reply. To be clear, as stated in my
original post, if a user is interacting with the PostgreSQL database,
changes to the data folder continue even after the PG_START_BACKUP
command has been issued. This implies to me that the contents of any
copy of the data folder may be unreliable. i.e. the copy may not reflect
the state of the data folder either before the copy started or after the
copy has finished. It may reflect the state of the data folder in some
transient form. Assuming this is true, is the copy still usable for
restoration? If so, how does PostgreSQL get the data folder to a stable
state? Is it by the use of the WAL files that may be created during the
backup process and the restore.config file?

-----Original Message-----
From: Ian Lea [mailto:ian.lea@gmail.com] 
Sent: Friday, April 08, 2011 3:55 AM
To: David Roland
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] pg_start_backup - backups

> Attempting to run a backup with the database online. I first issue 
> 'PG_START_BACKUP', then copy the contents of the postgresql data 
> folder, then issue 'PG_STOP_BACKUP'. The database service remains 
> running during the copy. If queries continue to hit the database after

> the PG_START_BACKUP command is issued changes to the data folder are 
> possible, which can cause copy errors (for instance, a file not found 
> exception). The file copy method first creates a string array of the 
> data folder contents (all folders and
> files) and then processes the array, copying one file at a time. What 
> am I doing wrong?

You need to use a program to do the copying that can accept changes to
files as it runs.  rsync is a common choice and has the massive
advantage that it only takes changes and is therefore, after the first
run, quick.

See
http://www.postgresql.org/docs/9.0/static/continuous-archiving.html#BACK
UP-BASE-BACKUP
or use your favourite search engine to find more info.


--
Ian.



view thread (6+ messages)  latest in thread

Message-ID: <7E0E9F0DF4C17A40BE6F616E6492B4D353E507@ExchangeVM.DOCS.COM>
Permalink:  ../7E0E9F0DF4C17A40BE6F616E6492B4D353E507@ExchangeVM.DOCS.COM/
Also on:    postgresql.org/message-id/7E0E9F0DF4C17A40BE6F616E6492B4D353E507@ExchangeVM.DOCS.COM

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: david.roland@soapware.com, ian.lea@gmail.com
  Subject: Re: pg_start_backup - backups
  In-Reply-To: <7E0E9F0DF4C17A40BE6F616E6492B4D353E507@ExchangeVM.DOCS.COM>
  References: <1302200280041-4289135.post@n5.nabble.com> <BANLkTik2vMyXb7EyeQLVUW8waAKDBaU4rA@mail.gmail.com> <7E0E9F0DF4C17A40BE6F616E6492B4D353E507@ExchangeVM.DOCS.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox