]> granicus.if.org Git - postgresql/commitdiff
Add C comment about DDL changes possibly causing pg_dump errors.
authorBruce Momjian <bruce@momjian.us>
Wed, 3 Mar 2010 23:38:44 +0000 (23:38 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 3 Mar 2010 23:38:44 +0000 (23:38 +0000)
src/bin/pg_dump/pg_dump.c

index 44bdddaf88d81c4f0a70afa834ee7ca6ef153978..18dd71e364f7415697bfc83a198687a4ee019ec5 100644 (file)
  *     script that reproduces the schema in terms of SQL that is understood
  *     by PostgreSQL
  *
+ *     Note that pg_dump runs in a serializable transaction, so it sees a
+ *     consistent snapshot of the database including system catalogs.
+ *     However, it relies in part on various specialized backend functions
+ *     like pg_get_indexdef(), and those things tend to run on SnapshotNow
+ *     time, ie they look at the currently committed state.  So it is
+ *     possible to get 'cache lookup failed' error if someone performs DDL
+ *     changes while a dump is happening. The window for this sort of thing
+ *     is from the beginning of the serializable transaction to
+ *     getSchemaData() (when pg_dump acquires AccessShareLock on every
+ *     table it intends to dump). It isn't very large, but it can happen.
+ *
+ *     http://archives.postgresql.org/pgsql-bugs/2010-02/msg00187.php
+ *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.576 2010/03/03 20:10:48 heikki Exp $
+ *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.577 2010/03/03 23:38:44 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */