Re: insert binary data into a table column with psql

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: insert binary data into a table column with psql
Дата
Msg-id juo69g$auo$1@dough.gmane.org
обсуждение исходный текст
Ответ на Re: insert binary data into a table column with psql  (jtkells <jtkells@verizon.net>)
Список 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 по дате отправления:

Предыдущее
От: Lonni J Friedman
Дата:
Сообщение: Re: insert binary data into a table column with psql
Следующее
От: Marcin Mańk
Дата:
Сообщение: Re: Odd corruption issue reported on dba.stackexchange.com, need advice