Hi all

I've started a very simple compojure project to wet my feet with
Clojure. I've written a simple model changing function:

(defn approve! [id]
  (sql/with-connection db
    (sql/transaction
     (sql/update-values :comments
                        ["id = ?" id]
                        {:approved true}))))

but I can't make it work. The exception thrown is:

#<BatchUpdateException java.sql.BatchUpdateException: Batch entry 0
UPDATE comments SET approved='1' WHERE id = '1' was aborted.  Call
getNextException to see the cause.>

calling getNextException gives:

#<PSQLException org.postgresql.util.PSQLException: ERROR: operator
does not exist: integer = character varying
  Hint: No operator matches the given name and argument type(s). You
might need to add explicit type casts.
  Position: 42>

I'm at a bit of a loss. "UPDATE comments SET approved='1' WHERE id =
'1'" works fine in psql. approved is a boolean field, so is this an
issue with the SQL library producing incorrect SQL?

Full code is at https://github.com/Wilfred/blog-comments and any
pointers would be much appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to