Fork me on GitHub
#sql
<
2021-08-14
>
v3ga02:08:43

Not sure if this is the proper channel or not but can someone tell me why i’m getting a “org.postgresql.util.PSQLException: ERROR: operator does not exist: integer = character varying” error? https://gist.github.com/v3gal0g/69a838fb1fdedd1929845ce5e0c0a0f4

hiredman03:08:15

It is because your need to parse the I'd from a string to a number

hiredman03:08:49

some dbs are more forgiving of that sort of thing and some are less

v3ga03:08:23

Thank you sir… I’ve been going through hell for a few hours with different little problems with that being the final . Integer/parseInt should be fine right?

dpsutton03:08:16

Most common to use longs as the basic integral type

dpsutton03:08:47

Did you get a stack trace? I saw you posted a snippet of one there

v3ga03:08:31

I lost the initial, just recreated…

dpsutton04:08:16

that is pretty difficult to read. what's on line 96 of origin.clj? oasisxd.origin/fn origin.clj: 96

v3ga04:08:11

#spy/p (db/query! (db/delete-book id) I’ve since wrapped I’d in Integer/parse and that gives me what I want. You suggest long?

dpsutton04:08:08

yes that's more or less the default for clojure. (type 5) will report it as a long

v3ga04:08:52

Ok, well I’ll do that then when I wake up I’ll do some refactoring so I don’t have to repeat type casting like that. Newbie adventures