From: | jkells <jtkells(at)verizon(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | insert binary data into a table column with psql |
Date: | 2012-07-24 20:28:01 |
Message-ID: | lzDPr.563398$2a.488105@en-nntp-14.dc1.easynews.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Edson Richter | 2012-07-24 20:36:09 | Pg 9.1: Do I need to run vacuum analyze instead vacuum full? |
Previous Message | Dmitriy Igrishin | 2012-07-24 16:53:38 | Re: Roles with empty password (probably bug in libpq and in psql as well). |