inserting/updating a field with the contents of a text file - Mailing list pgsql-novice

From Lonni J Friedman
Subject inserting/updating a field with the contents of a text file
Date
Msg-id 7c1574a90709241657lf06fe7bx29be6542d04d2762@mail.gmail.com
Whole thread Raw
Responses Re: inserting/updating a field with the contents of a text file  ("George Pavlov" <gpavlov@mynewplace.com>)
List 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 by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: Odbc connection
Next
From: "George Pavlov"
Date:
Subject: Re: inserting/updating a field with the contents of a text file