pg_upgrade: Use COPY for LO metadata for upgrades from < v12.
Nathan Bossart <nathan@postgresql.org>
pg_upgrade: Use COPY for LO metadata for upgrades from < v12. Before v12, pg_largeobject_metadata was defined WITH OIDS, so unlike newer versions, the "oid" column was a hidden system column that pg_dump's getTableAttrs() will not pick up. Thus, for commit 161a3e8b68, we did not bother trying to use COPY for pg_largeobject_metadata for upgrades from older versions. This commit removes that restriction by adjusting the query in getTableAttrs() to pick up the "oid" system column and by teaching dumpTableData_copy() to use COPY (SELECT ...) for this catalog, since system columns cannot be used in COPY's column list. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/aYzuAz_ITUpd9ZvH%40nathan
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_dump/pg_backup_archiver.c | modified | +2 −5 |
| src/bin/pg_dump/pg_dump.c | modified | +38 −39 |
Discussion
- pg_upgrade: transfer pg_largeobject_metadata's files when possible 39 messages · 2025-08-14 → 2026-02-16