Re: Exporting a PDF from a bytea column

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Exporting a PDF from a bytea column
Дата
Msg-id 56C67BDA.6060800@hogranch.com
обсуждение исходный текст
Ответ на Exporting a PDF from a bytea column  (CS DBA <cs_dba@consistentstate.com>)
Ответы Re: Exporting a PDF from a bytea column  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
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.

bytea columns are regular SQL database columns that contain a binary
byte array.    large objects (LO) are a whole separate facility, where
each object is referenced by a unique OID, and the object is read and
written with the lo_XXX() functions in libpq, or equivalents in other
language specific bindings.
http://www.postgresql.org/docs/current/static/largeobjects.html

in a C program, an LO can be exported to a file via the API lo_export()
http://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-EXPORT


> 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.

--
john r pierce, recycling bits in santa cruz



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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Live steraming replication setup issue!
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Exporting a PDF from a bytea column