Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax error in a simple UPDATE query

Tags:

postgresql

I have this query (PostgreSQL 9.1):

=> update tbp set super_answer = null where packet_id = 18;
ERROR:  syntax error at or near "="

I don't get it. I'm really out of words here.

                Table "public.tbp"
    Column    |          Type          | Modifiers 
--------------+------------------------+-----------
 id           | bigint                 | not null
 super_answer | bigint                 | 
 packet_id    | bigint                 | 
like image 970
janek37 Avatar asked Feb 28 '13 09:02

janek37


1 Answers

It turned out I've copied some white unicode character and Postgres didn't like it. In a Python console:

>>> u'update "tbp" set "super_answer"=null where "packet_id" = 18'
u'update "tbp" set\xa0"super_answer"=null where "packet_id" = 18'

Life can be strange sometimes.

like image 183
janek37 Avatar answered Nov 15 '22 06:11

janek37