I\'m working with PostgreSQL and Spring 4 and want my app auto create database when it running.
My Entity Class is:
@Entity
@Table(name = \"user\", s
Postgres unlike mysql does not support Create Database If not exist.
Thus changing hibernate.hbm2ddl.auto=create and changing URL jdbc.url=jdbc:postgresql://localhost/database?createDatabaseIfNotExist=true
won't work for you.
However you can try simulating the behavior as in below questions:
Create Postgres database on the fly, if it doesn't exists using Hibernate
Simulate CREATE DATABASE IF NOT EXISTS for PostgreSQL?