insert binary data into a table column with psql

Поиск
Список
Период
Сортировка
От jkells
Тема insert binary data into a table column with psql
Дата
Msg-id lzDPr.563398$2a.488105@en-nntp-14.dc1.easynews.com
обсуждение исходный текст
Ответы Re: insert binary data into a table column with psql  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
I am running REDHAT 5.5 64 bit with PostgreSQL 8.4.7 64 bit.  I am trying
to load a binary file into a bytea column into a table without any luck
from psql.
On the linux server a script is looking for a file and if found would
create a record into a table that contains a ID, date of load and the
file in the bytea column.
table looks like the following
table x
(ID number,
 load_date date,
 image  bytea
)
from psql
I have tried several ways including creating a function to read a file
without any success but basically I want to do something like the
following from a bash shell

psql <connection information> -c "insert into x (ID, load_date, image)
values ($PID,clock_timestamp()::timestamp(0), copy from '/tmp/$FN' with
binary);"

Any help would be greatly appreciated

John

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

Предыдущее
От: Edson Richter
Дата:
Сообщение: Pg 9.1: Do I need to run vacuum analyze instead vacuum full?
Следующее
От: François Beausoleil
Дата:
Сообщение: Re: Pg 9.1: Do I need to run vacuum analyze instead vacuum full?