postgresql UPDATE错误“错误:boolean类型的输入语法无效:”

前端之家收集整理的这篇文章主要介绍了postgresql UPDATE错误“错误:boolean类型的输入语法无效:”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试在 postgresql上进行简单的更新查询.我没有真正理解错误,因为没有布尔值或列类型.
这是日志:
cat=> UPDATE categories SET epekcategoryid='27af8b1e-c0c9-4084-8304-256b2ae0c8b2' and epekparentcategoryid='root' WHERE categoryId='281' and siteid='0' and categoryparentid='-1';
ERROR:  invalid input Syntax for type boolean: "27af8b1e-c0c9-4084-8304-256b2ae0c8b2"
LINE 1: UPDATE categories SET epekcategoryid='27af8b1e-c0c9-4084-830...

表配置:

cat=> \d categories;
                Table "public.categories"
        Column        |         Type          | Modifiers 
----------------------+-----------------------+-----------
 categoryid           | character varying(32) | 
 categoryname         | text                  | 
 siteid               | integer               | 
 categoryparentid     | character varying(32) | 
 status               | integer               | default 0
 epekcategoryid       | text                  | 
 epekparentcategoryid | text                  | 
 categorylevel        | character varying(37) | 
 categoryidpath       | character varying(37) | 
尝试:
UPDATE categories 
SET epekcategoryid='27af8b1e-c0c9-4084-8304-256b2ae0c8b2',epekparentcategoryid='root' 
WHERE categoryId='281' 
  and siteid='0' 
  and categoryparentid='-1';

您必须将SET部分中的字段与“,”分开,而不是与“AND”分​​隔

原文链接:https://www.f2er.com/postgresql/192018.html

猜你在找的Postgre SQL相关文章