Re: ERROR: syntax error at or near ":"

From: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
To: Graham Leggett <minfrin(at)sharp(dot)fm>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: ERROR: syntax error at or near ":"
Date: 2013-03-06 23:05:55
Message-ID: CAB8KJ=hCtG0EzvFpfdKoBHJrHT4wEqYBGU0QdOn_p9XJKi0VvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2013/3/7 Graham Leggett <minfrin(at)sharp(dot)fm>:
> Hi all,
>
> I have a text file, and I need to update the value of an element in a table with the contents of this text file. Following the instructions at http://stackoverflow.com/questions/10968039/postgresql-inserting-value-of-a-column-from-a-file I tried this, but get the error below, which I do not understand.
>
> Can anyone explain what might be going wrong, and what I should do instead?
>
> patricia=# \set content `cat /tmp/certificates.txt`
> patricia=# update property set value = :'content' where key = 'patricia.home.security.cacerts';
> ERROR: syntax error at or near ":"
> LINE 1: update property set value = :'content' where key = 'patricia...

That should work...

Which psql version are you using, and what is the table definition?

Does the same error occur if you attempt to insert data from a
different text file?

Regards

Ian Barwick

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2013-03-06 23:09:39 Re: ERROR: syntax error at or near ":"
Previous Message Greg Williamson 2013-03-06 23:04:15 Re: ERROR: syntax error at or near ":"