1

I have a super large database in postgresql 13, the size if 1 TB and I need to migrate only one schema to another database, the problem is that this schema has blobs. So if I migrate with pg_dump and the --blobs property, the command makes a backup of all the blobs in the database and I only want it to store only the blobs of this scheme. is this possible? this is the command i am executing to do the dump.

pg_dump --host=$HOST_ORIGIN --dbname=$BD_ORIGIN --port=$BD_PORT_ORIGIN --username=$BD_USER_ORIGIN --schema=$SCHEMA --no-privileges --blobs -v -Fc > schema.sql
asked Feb 10, 2022 at 18:18
2
  • You're quite sure about this? It would indicate a bug in PostgreSQL. Commented Feb 10, 2022 at 20:31
  • Cross-Post: stackoverflow.com/questions/71068179/… Commented Oct 25, 2022 at 9:41

1 Answer 1

2

The problem is that large objects don't belong to a specific schema. What you mean is that only some of those large objects are referenced from tables in your schema. Now this reference is not known to the database (there is no referential integrity), so there is no feature to do what you want.

Perhaps you can write some code to extract only the large objects you need, but there is no help from PostgreSQL. Yoü have just learned one of the reasons why large objects should be avoided.

answered Feb 11, 2022 at 8:38

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.