inserting/updating a field with the contents of a text file

Поиск
Список
Период
Сортировка
От Lonni J Friedman
Тема inserting/updating a field with the contents of a text file
Дата
Msg-id 7c1574a90709241657lf06fe7bx29be6542d04d2762@mail.gmail.com
обсуждение исходный текст
Ответы Re: inserting/updating a field with the contents of a text file  ("George Pavlov" <gpavlov@mynewplace.com>)
Список pgsql-novice
Greetings,
I've googled a bit on this, and didn't find any clear answers.  I've
got a table with several columns, one of which I'd like to hold the
contents of text files.  What I tried doing was using psql to do
something like:
psql -q -d database0 -h server -c "UPDATE table set info='`cat
/tmp/file.txt`' where id=3;"

and this almost works.  The problem is that whenever there are
carriage returns in file.txt, the rest of the file contents never get
inserted (i only get the first line).

It seems like i'd need to somehow escape out the carriage returns, but
I"m not sure how to do this without altering the contents of file.txt.

thanks for any pointers.

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

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: Odbc connection
Следующее
От: "George Pavlov"
Дата:
Сообщение: Re: inserting/updating a field with the contents of a text file