Search Postgresql Archives

Re: Exporting a PDF from a bytea column

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 18, 2016 at 7:42 PM, CS DBA <cs_dba@xxxxxxxxxxxxxxxxxxx> wrote:

Short answer, to avoid the binary blob problem, is to encode the binary data, export it, then decode it.

This can be done is psql.  If your client can handle binary directly (e.g, JDBC/Java) you can use that language's facilities to perform the binary transfer directly thus bypassing the need to transcode.
Can it be done from a Linux shell script?  Any examples? Seems to be little info on this in my googling?

​Others may provide actual examples but at the moment I don't have the time to explore to that depth.

To answer your "shell script" question...anything can be done in a shell script - as long as you have the right programs on your system to do the actual work.  I already mentioned "psql" which, if you want the least amount of pure "coding", is going to be the helper program you will want to use.  And its usage is well documented.  I would suggest base64 encoding and then using whatever standard base64 decoder program exists on your Linux box to perform the decoding.

David J.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux