Re: Exporting a PDF from a bytea column

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Exporting a PDF from a bytea column
Дата
Msg-id CAKFQuwayGkjeQBqMfPSW7XquUfDf62BKmqVso6bJTZh0tyCOAA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Exporting a PDF from a bytea column  (CS DBA <cs_dba@consistentstate.com>)
Список pgsql-general
On Thu, Feb 18, 2016 at 7:42 PM, CS DBA <cs_dba@consistentstate.com> 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.

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

Предыдущее
От: Deven Phillips
Дата:
Сообщение: Re: Appending key-value to JSONB tree
Следующее
От: Victor Blomqvist
Дата:
Сообщение: Re: Query plan not updated after dropped index