Re: Consistent state for pg_dump and pg_dumpall

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Michael Nolan <htfoot(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Consistent state for pg_dump and pg_dumpall
Date: 2015-05-20 16:40:03
Message-ID: CAKFQuwYJgV4G2eOfVq7XPp+8P5ZO9mnyAPPhKOv5ZP5aiRpRsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes. The entire dump is performed within a single transaction.

On Wed, May 20, 2015 at 9:24 AM, Michael Nolan <htfoot(at)gmail(dot)com> wrote:

> The documentation for pg_dump says that dump files are created in a
> consistent state.
>
> Is that true across multiple tables in the same pg_dump command?
> (Obviously it would not be true if I dumped tables using separate pg_dump
> commands.
>




Yes. The entire dump is performed within a single transaction.​

But if I put the database into a backup state using 'pg_start_backup',
> would separately executed pg_dump commands be in a consistent state across
> the set of dump files?)
>
>
​pg_start_backup and pg_dump are not designed to work together.​ Namely,
pg_start_backup is mostly concerned with making sure future writes are
accounted for in the final backup while pg_dump says to ignore everything
that happens after the command begins.

The documentation for pg_dumpall does not say that its dump file is in a
> consistent state (eg, across all tables), but it does say that it uses
> pg_dump to dump clusters. So, how consistent are the tables in pg_dumpall
> files?
>

Each database is internally consistent. There is no guarantee that
databases and globals are consistent with each other (though those are
typically seldom changed) but different databases will to represent the
same point in time vis-a-vis each other.

You might want to describe what you are trying to do here.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Nolan 2015-05-20 17:44:41 Re: Consistent state for pg_dump and pg_dumpall
Previous Message Michael Nolan 2015-05-20 16:24:50 Consistent state for pg_dump and pg_dumpall