Re: pg_dump issues - Mailing list pgsql-hackers

From Florian Pflug
Subject Re: pg_dump issues
Date
Msg-id 24B1FA58-50E4-41ED-B237-05540DABA25B@phlo.org
Whole thread Raw
In response to Re: pg_dump issues  (Joe Abbate <jma@freedomcircle.com>)
List pgsql-hackers
On Oct2, 2011, at 23:15 , Joe Abbate wrote:
> I'm
> somewhat surprised there appears to be no ability to lock a database
> exclusively for something like pg_dump/pg_restore, so you're not
> surprised by concurrent activity against the catalogs.  I'm guessing the
> assumption is that MVCC will take care of that?

I think the hope is more that it will, one day. Currently, postgres internally
accesses the catalog with SnapshotNow, not with a MVCC snapshot. This is
necessary to ensure, for example, that rows inserted into a table also get
inserted into a newly created index. This wouldn't affects pg_dump if it only
access the catalog via SQL, but it doesn't. pg_dump also depends on some server-side
functions to do its work, and since these functions in turn use SnapshotNow-based
internal backend functions, pg_dump essentially uses a mix of SnapshotNow and
its transaction's MVCC snapshot.

There has been talk about reducing the use of of SnapshotNow for catalog access,
but AFAIK there's no concrete proposal, and certainly no patch, available.

best regards,
Florian Pflug



pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Should we get rid of custom_variable_classes altogether?
Next
From: Fujii Masao
Date:
Subject: Re: [REVIEW] pg_last_xact_insert_timestamp