During pg_dump startup, acquire table locks in batches.
Tom Lane <tgl@sss.pgh.pa.us>
During pg_dump startup, acquire table locks in batches. Combine multiple LOCK TABLE commands to reduce the number of round trips to the server. This is particularly helpful when dumping from a remote server, but it seems useful even without that. In particular, shortening the time from seeing a table in pg_class to acquiring lock on it reduces the window for trouble from concurrent DDL. Aleksander Alekseev, reviewed by Fabrízio de Royes Mello, Gilles Darold, and Andres Freund Discussion: https://postgr.es/m/CAJ7c6TO4z1+OBa-R+fC8FnaUgbEWJUf2Kq=nRngTW5EXtKru2g@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_dump/pg_dump.c | modified | +31 −5 |
Discussion
- [PATCH] pg_dump: lock tables in batches 15 messages · 2022-12-07 → 2023-01-03