Re: several questions about pg_dumpall, pg_start_backup, pg_basebackup and WAL

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: Patrick Dung <patrick_dkt(at)yahoo(dot)com(dot)hk>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: several questions about pg_dumpall, pg_start_backup, pg_basebackup and WAL
Date: 2013-08-23 08:14:43
Message-ID: A737B7A37273E048B164557ADEF4A58B17C08086@ntex2010a.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Patrick Dung wrote:
> I have some questions about backup on PostgreSQL:
>
> 1) pg_dumpall
> I am sure that this is asked in somewhere: why the pg_dumpall does not support custom or tar format
> like pg_dump.
> I have heard that the custom format could be faster and may generate a smaller dump file.
> Is the feature enhancement being developed?

I suspect that the reason is that pg_dumpall just calls pg_dump
and concatenates the output, and that probably only works
in text format.

> 2) pg_start_backup in postgresql 8.4
> After issuing pg_start_backup, we can take the file based backup (by tar/snapshot) on the postgresql
> data directory.
> If the use of file system snapshot is not possible.

I don't understand this sentence.

> It is possible that there is file changes (added or file size changed) between the pg_start_backup and
> pg_stop_backup.

Yes.

> Is the backup consistent?

The tar or snapshot itself will not be consistent, it will have to be recovered
at least until the end on the online backup.

> 3) extension of 2): If the postgresql version is 9.2
> Is pg_basebackup better than pg_start_backup + file based backup + pg_stop_backup?

Technically they are equivalent.
pg_basebackup may be easier to use, the other option may provide
more flexibility.

One difference is that there can be many pg_basebackups running at the
same time.

> 4) For the WAL backup in postgresql 8.4
> After the archive mode is on and WAL is backup, how do I remove the old WAL files?
> How about newer version (for example 9.2?)

You never touch the files in pg_xlog on a running server.

You remove old WAL archives when you don't need them any more.
Usually that is when there is no older base backup.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Salvatore Barone 2013-08-23 14:49:08 question on the information_schema
Previous Message Tom Lane 2013-08-22 23:16:55 Re: Getting "Out of memory" errors on server 9.1.9

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2013-08-23 08:30:01 Re: Does larger i/o size make sense?
Previous Message Sawada Masahiko 2013-08-23 07:42:23 Behaviour of take over the synchronous replication