Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

postgresql UPDATE error " ERROR: invalid input syntax for type boolean: "

Tags:

I'm trying to make a simple update query on postgresql. I don't really understand the error as there is no boolean value or column type. Here is the log :

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... 

The table config :

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) | 
like image 233
themihai Avatar asked Nov 21 '12 14:11

themihai


1 Answers

Try:

UPDATE categories  SET epekcategoryid='27af8b1e-c0c9-4084-8304-256b2ae0c8b2',     epekparentcategoryid='root'  WHERE categoryId='281'    and siteid='0'    and categoryparentid='-1'; 

You must separate fields in SET part with "," , not with "AND"

like image 95
Ihor Romanchenko Avatar answered Sep 20 '22 17:09

Ihor Romanchenko