Re: ERROR: syntax error at or near ":" - Mailing list pgsql-general

From Adrian Klaver
Subject Re: ERROR: syntax error at or near ":"
Date
Msg-id 5137CD7E.2010504@gmail.com
Whole thread Raw
In response to Re: ERROR: syntax error at or near ":"  (Greg Williamson <gwilliamson39@yahoo.com>)
Responses Re: ERROR: syntax error at or near ":"
List pgsql-general
On 03/06/2013 03:04 PM, Greg Williamson wrote:
>
>
> Graham --
>
>> ________________________________
>> From: Graham Leggett <minfrin@sharp.fm>
>> To: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
>> Sent: Wednesday, March 6, 2013 2:41 PM
>> Subject: [GENERAL] ERROR:  syntax error at or near ":"
>>
>> 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.
Followingthe instructions at
http://stackoverflow.com/questions/10968039/postgresql-inserting-value-of-a-column-from-a-fileI tried this, but get the
errorbelow, 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...
>>                                      ^
>>
> The colon (":") is not needed, just remove it. A pair of colons is used to indicate a cast of a value; off hand I am
notcoming up with any use of a colon in basic SQL. 

http://www.postgresql.org/docs/9.2/interactive/app-psql.html#APP-PSQL-INTERPOLATION

>
> Greg W.
>
>
>


--
Adrian Klaver
adrian.klaver@gmail.com


pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: WAL_DEBUG
Next
From: ning chan
Date:
Subject: Re: WAL_DEBUG