We have a simple table my_table like :
id (int) -> primary key
object_id (Large Object)
Unfortunately, a contractor of us have run lo_unlink on the IDs of the large objects from the column object_id of the table my_table.
The Large Object ID are still in the table, but the associated Large Objects not exist anymore :
ERROR: large object 10268782 does not exist
SQL state: 42704
We do backup with pg_dump every night.
How we can restore only the Large Object with pg_restore ?
Indeed, we don't need to restore all the tables, even not the table with LOB ID (because the ID are still defined), but reload only the Large Object into the database from the dump.
The pg_restore has an option :
--data-only
Restore only the data, not the schema (data definitions). Table data, large objects, and sequence values are restored, if present in the archive.
but we don't want to restore table data or sequence values. Just large objects.
Thank you