KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Using the clojure jdbc library with postgresql. I have a table "xxx" with a timestamp column "created_at" in postgresql, and I have a string containing a date in the right format. Doing an insert fails: (require '[clojure.java.jdbc :as sql]) (sql/with-connection *db* (sql/insert-record :xxx {:created_at "Thu Feb 09 10:38:01 +0000 2012"})) Here is the error: org.postgresql.util.PSQLException: ERROR: column "created_at" is of type timestamp with time zone but expression is of type character varying So I understand that postgres requires a timestamp value, but how do I convert my string representation of the date into something postgres will accept? java.util.Date fails also, and I can't find any docs on the clojure postgres library. Thanks!
Tags (comma-separated)
Save Edits
Cancel