Re: [GENERAL] how to save a bytea value into a file?

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: [GENERAL] how to save a bytea value into a file?
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C206F74397@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Re: [GENERAL] how to save a bytea value into a file?  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Ответы Re: [GENERAL] how to save a bytea value into a file?  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-admin
I wrote:
[fanlijing wants to write bytea to file]
> A simple
>    COPY (SELECT byteacol WROM mytab WHERE ...) TO 'filename' (FORMAT
binary)
> should do the trick.

Corrections:
a) "binary" must be surrounded by single quotes.
b) that won't dump just the binary data - you would have
   to remove the first 25 bytes and the last 2 bytes...

So maybe using the functions I mentioned would be the
best way after all.

You could also write your own user defined function in C.

Yours,
Laurenz Albe

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

Предыдущее
От: jesper@krogh.cc
Дата:
Сообщение: pg_lesslog
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: [GENERAL] how to save a bytea value into a file?