Thread: pg_dump and concurrent DDL activity

pg_dump and concurrent DDL activity

From
Ashutosh Bapat
Date:
Hi All,
prologue of pg_dump.c says
 *  Note that pg_dump runs in a transaction-snapshot mode 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 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 acquisition
 *  of the transaction snapshot to getSchemaData() (when pg_dump acquires
 *  AccessShareLock on every table it intends to dump). It isn't very large,
 *  but it can happen.

But this possible failure has not been documented at
https://www.postgresql.org/docs/12/app-pgdump.html. Although the
window for failure is small, it's not impossible.Should we document
this kind of failure?

-- 
Best Wishes,
Ashutosh Bapat