ro ra
ro ra

Reputation: 419

how to read data stored in blobs

my application datbase in postgressql and from the document i understand that it store few data in a blob and from the table i can only get the oid of it.

is there any possibility to read the content from these blobs? if yes, could someone share the knowhow?

Upvotes: 0

Views: 600

Answers (1)

Daniel Vérité
Daniel Vérité

Reputation: 61526

From the OID, a file with the contents of the large object can be exported.

Either client-side (psql):

  \lo_export oid-to-export /path/to/a/file

Or server-side in SQL (creates the file on the server, beware that postgres must have the permission to write into the destination directory).

   SELECT lo_export(oid-to-export, '/path/to/a/file');

Upvotes: 1

Related Questions