This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-24
Channels
- # aws (3)
- # aws-lambda (1)
- # beginners (16)
- # boot (36)
- # cider (3)
- # cljs-dev (90)
- # cljsjs (1)
- # cljsrn (27)
- # clojure (240)
- # clojure-austin (1)
- # clojure-berlin (3)
- # clojure-dusseldorf (2)
- # clojure-france (2)
- # clojure-germany (12)
- # clojure-russia (19)
- # clojure-spec (20)
- # clojure-uk (56)
- # clojurescript (218)
- # clojurex (1)
- # cursive (21)
- # datomic (10)
- # events (1)
- # hoplon (18)
- # instaparse (19)
- # jobs-discuss (3)
- # lein-figwheel (3)
- # luminus (3)
- # lumo (14)
- # off-topic (4)
- # om (76)
- # onyx (67)
- # protorepl (12)
- # re-frame (54)
- # reagent (35)
- # ring (2)
- # spacemacs (5)
- # specter (2)
- # sql (11)
- # untangled (144)
- # yada (34)
👋:skin-tone-4: - I'd like to use java.jdbc with postgres jsonb. is there something specific i need to do in order to work with such types?
I get this error when I try to insert:
user=> (j/insert-multi! db :schemas [ {:datab {:hello 123}} ])
PSQLException ERROR: column "datab" is of type jsonb but expression is of type hstore
Hint: You will need to rewrite or cast the expression.
Position: 40 org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse (QueryExecutorImpl.java:2412)
Take a look at http://clojure-doc.org/articles/ecosystem/java_jdbc/using_sql.html#protocol-extensions-for-transforming-values
PostgreSQL is kinda weird with so many custom data types 😐
Or you could use raw SQL with a CAST()
in it, via the j/execute!
function
ah cool! thanks for pointing me in the right direction. so i'll have to modify a few protocols and i should be set! definitely weird 🙂
BTW, there’s a java.jdbc mailing list so once you have that working, you might consider joining that list and posting your solution there so it’s in the archives for the future!
No, thank you (in advance!).
That documentation is community-maintained so feel free to add issues and/or send PRs.