Re: How to store text files in the postgresql?

Поиск
Список
Период
Сортировка
От Florian Weimer
Тема Re: How to store text files in the postgresql?
Дата
Msg-id 87y6s41k9q.fsf@mid.deneb.enyo.de
обсуждение исходный текст
Ответ на Re: How to store text files in the postgresql?  (DimitryASuplatov <genesup@gmail.com>)
Список pgsql-general
* DimitryASuplatov:

> I`ve also worked out how to do this simply from bash
>
> ./bin/psql mypdb <<EOF
> insert into pdb values ('`cat /file/name`');
> EOF

This doesn't work if the file contains embedded "'" characters (and
backslashes and NULs are also problematic).  You will also get errors
if the file encoding does not match the database encoding.

You probably should use a BYTEA column and a little Perl script which
uses bind_param to specify a type of PG_BYTEA for the parameter.

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: limit table to one row
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: xml to table (as oppose to table to xml)