restore OIDs

From: Dino Mifsud <dinomifsud74(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: restore OIDs
Date: 2018-03-16 08:56:11
Message-ID: CAEkXPXk8hE3GAnhxEO4nD3RX+2MnhLmS1=jgVPhikEq6i4Uy_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I have a table where I am storing images in a column of type OID which is
pointing to the pg_largeobject table.

Now when I try do a pg_dump and restore just a schema from one database to
another with the below commands, the OID column in the table is correctly
restored with the original number but the pg_largeobject table in the
restored database does not contain these OID entries that store the actual
image bytes and therefore the images are not restored.

pg_dump --data-only --host localhost --port 5432 --username "postgres"
--schema=myschema --format custom --verbose --file
"/Users/myuser/Work/databases_backup/original.backup" "db1"

pg_restore --host localhostd --port 5432 --username "postgres"
--schema=myshcema --disable-triggers -d db2
"/Users/myuser/Work/databases_backup/original.backup"

How can I dump and restore correctly just a particular schema?

Thanks

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2018-03-16 09:40:52 Re: restore OIDs
Previous Message Jerry Sievers 2018-03-15 17:55:09 Wal fetching standby refuses to promote