Обсуждение: BLOBS from psql...

Поиск
Список
Период
Сортировка

BLOBS from psql...

От
A James Lewis
Дата:

Is there any way to enter a large object (Binary) into a database using
psql... or any other tool I can run from a shell script...

Ideally I need to be able to take stdin and put it in a particular place
in a table....  Then obviously get it back out later...


James (james@linuxrocks.co.uk)
Vortex Internet
My Windows unders~1 long filena~1, and yours?


Re: [GENERAL] BLOBS from psql...

От
Peter T Mount
Дата:
On Wed, 4 Nov 1998, A James Lewis wrote:

>
>
> Is there any way to enter a large object (Binary) into a database using
> psql... or any other tool I can run from a shell script...

There are the lo_import and lo_export functions, but the file has to be on
the backend for them.

> Ideally I need to be able to take stdin and put it in a particular place
> in a table....  Then obviously get it back out later...

The easiest way is to write a small client using libpq that does it for
you.

I'm thinking on the lines of:

$> blob -i <my-src-file

and

$> blob -o >my-dest-file

It's been a while since I've used libpq, but there are some examples you
could hack to do this in the source tree.

--
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf