clojure « postgresql « Java Database Q&A

1. Driver issue with PostgreSQL/Clojure

I am attempting to access a Postgres database inside of Clojure. I've found a ton of examples of projects using DBs, setting up the database like this:

(def db

2. Clojure/postgresql: How do I access the enum values from the Jdbc4Array results?

I have an enum in postgresql defined like so:

create type color as enum ('yellow', 'purple', 'white', 'black');
And I can get to the Jdbc4Array like so:
(def colors 
  ((first (sql/with-connection db/db ...

3. How do I drop or create a database from

I would like to create/drop a database from This fails:

(require '[ :as sql])

(def db
  {:classname "org.postgresql.Driver"
   :subprotocol "postgresql"
   :subname "//localhost/postgres"
   :user "postgres"})

(defn ...