My database name is erace (not to have to type the actual name of the database each time I invoke psql).
- Get JDBC Driver for PostgreSQL
- Drop the jar in $project_home/lib
- Change $project_home/conf/DataSource.groovy to this:
dataSource { pooled = true driverClassName = "org.postgresql.Driver" username = "erace" password = "passw0rd" } hibernate { cache.use_second_level_cache=true cache.use_query_cache=true cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider' } environments { development { dataSource { dbCreate = "update" // one of 'create', 'create-drop','update' url = "jdbc:postgresql:erace" } } test { dataSource { dbCreate = "update" url = "jdbc:postgresql:erace" } } production { dataSource { dbCreate = "update" url = "jdbc:postgresql:erace" } } }
Docs:
Grails Ref Guide on DataSource
Thanks for the post.
Brief and useful.