6

我有这个查询(PostgreSQL 9.1):

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

我不明白。我这里真的无语了。

                Table "public.tbp"
    Column    |          Type          | Modifiers 
--------------+------------------------+-----------
 id           | bigint                 | not null
 super_answer | bigint                 | 
 packet_id    | bigint                 | 
4

1 回答 1

14

原来我复制了一些白色的 unicode 字符,而 Postgres 不喜欢它。在 Python 控制台中:

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

生活有时会很奇怪。

于 2013-02-28T10:15:05.490 回答