From: | CS DBA <cs_dba(at)consistentstate(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Exporting a PDF from a bytea column |
Date: | 2016-02-19 02:42:08 |
Message-ID: | 56C68100.6080208@consistentstate.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 02/18/2016 07:29 PM, David G. Johnston wrote:
> On Thursday, February 18, 2016, John R Pierce <pierce(at)hogranch(dot)com
> <mailto:pierce(at)hogranch(dot)com>> wrote:
>
> On 2/18/2016 4:44 PM, CS DBA wrote:
>
> The system stores PDF's as large objects
> in bytea columns.
>
>
> Large Objects aka LO's and bytea columns are two completely
> different things.
>
>
> I'll assume the "column" is the most relevant term here because the
> above is true.
>
> Can anyone send me an example of
> exporting from a bytea column to a PDF file?
>
>
> I don't think you can get from a bytea field to a file without
> some coding, as SQL scripting doesn't handle binary blobs very well.
>
>
> http://www.postgresql.org/message-id/AANLkTi=2dARHQPRGTXmCx0aus9maHQ2SfxxbvihtuzDv@mail.gmail.com
>
> 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?
>
> David J,
From | Date | Subject | |
---|---|---|---|
Next Message | Deven Phillips | 2016-02-19 02:48:02 | Re: Appending key-value to JSONB tree |
Previous Message | David G. Johnston | 2016-02-19 02:29:30 | Re: Exporting a PDF from a bytea column |