Re: insert binary data into a table column with psql - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: insert binary data into a table column with psql
Date
Msg-id juo69g$auo$1@dough.gmane.org
Whole thread Raw
In response to Re: insert binary data into a table column with psql  (jtkells <jtkells@verizon.net>)
List pgsql-general
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 the client was
> running, picking up a local file and sending it into a remote database
> table.

If you can use a different client, you might want to look at SQL Workbench/J

It has support to do just that. You can write e.g.


insert into x (id, load_date, image)
values
(1, current_date, {$blobfile=/tmp/myimage.jpg});

and the file will be read from the client (where SQL Workbench is running).
(note that "large objects" are _not_ supported, only bytea)

http://www.sql-workbench.net/
http://www.sql-workbench.net/manual/using.html#blob-support

It's Java/JDBC based, has a GUI and console mode.

Disclaimer: I am the author of that tool.

Regards
Thomas



pgsql-general by date:

Previous
From: Lonni J Friedman
Date:
Subject: Re: insert binary data into a table column with psql
Next
From: Marcin Mańk
Date:
Subject: Re: Odd corruption issue reported on dba.stackexchange.com, need advice