I am trying to do the following:
UPDATE bodycontent set body=CONTENT_FROM_FILE where contentid=12943363;
I tried the following based on the highest voted answer to this question.
\set contentfill `cat Foo.txt`
UPDATE bodycontent set body=:'contentfill' where contentid=12943363;
This results in the following error.
ERROR: syntax error at or near ":"
LINE 1: UPDATE bodycontent set body=:'contentfill' where contentid=1...
Is there a clean, simple and effective way to achieve this on the psql
command line?
Here is the output of psql --version
:
psql (PostgreSQL) 8.4.17