Re: [GENERAL] insert binary data into a table column with psql

2012-07-30 Thread Jasen Betts
On 2012-07-30, Jasen Betts wrote: >> 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 -c "insert into x (ID, load_date, image) >> values ($PID,clock_timestamp()

Re: [GENERAL] insert binary data into a table column with psql

2012-07-30 Thread Jasen Betts
On 2012-07-24, jkells wrote: > 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

Re: [GENERAL] insert binary data into a table column with psql

2012-07-25 Thread Thomas Kellerer
jtkells, 25.07.2012 03:43: Thanks much for your reply, that does the trick quite nicely. But, I just came to the realization that this only works if your are running the client and the file both resides on the database server. I thought that I would be able to do this from a remote server where

Re: [GENERAL] insert binary data into a table column with psql

2012-07-24 Thread Lonni J Friedman
On Tue, Jul 24, 2012 at 7:16 PM, Tom Lane wrote: > jtkells writes: >> Thanks much for your reply, that does the trick quite nicely. But, I just >> came to the realization that this only works if your are running the >> client and the file both resides on the database server. I thought that >> I

Re: [GENERAL] insert binary data into a table column with psql

2012-07-24 Thread Tom Lane
jtkells writes: > Thanks much for your reply, that does the trick quite nicely. But, I just > came to the realization that this only works if your are running the > client and the file both resides on the database server. I thought that > I would be able to do this from a remote server where

Re: [GENERAL] insert binary data into a table column with psql

2012-07-24 Thread jtkells
On Tue, 24 Jul 2012 14:37:52 -0700, Lonni J Friedman wrote: > On Tue, Jul 24, 2012 at 2:22 PM, John R Pierce > wrote: >> On 07/24/12 1:28 PM, jkells wrote: >>> >>> from psql >>> I have tried several ways including creating a function to read a file >>> without any success but basically I want to

Re: [GENERAL] insert binary data into a table column with psql

2012-07-24 Thread Lonni J Friedman
On Tue, Jul 24, 2012 at 2:22 PM, John R Pierce wrote: > On 07/24/12 1:28 PM, jkells wrote: >> >> 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 -c "i

Re: [GENERAL] insert binary data into a table column with psql

2012-07-24 Thread John R Pierce
On 07/24/12 1:28 PM, jkells wrote: 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 -c "insert into x (ID, load_date, image) values ($PID,clock_timestamp()::timesta

[GENERAL] insert binary data into a table column with psql

2012-07-24 Thread jkells
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