Re: Exporting a PDF from a bytea column

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Exporting a PDF from a bytea column
Дата
Msg-id CAKFQuwYFNFZXsCfUWjrWwntR7k1sy+TJ881Br6iZq0TAnRxeuA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Exporting a PDF from a bytea column  (John R Pierce <pierce@hogranch.com>)
Ответы Re: Exporting a PDF from a bytea column  (CS DBA <cs_dba@consistentstate.com>)
Список pgsql-general
On Thursday, February 18, 2016, John R Pierce <pierce@hogranch.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.



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.

David J,
 

В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Exporting a PDF from a bytea column
Следующее
От: CS DBA
Дата:
Сообщение: Re: Exporting a PDF from a bytea column