title: Can Spring Data JPA automatically create database in PostgreSQL?
body: <p>I'm using Spring Boot, Spring Data JPA and PostgreSQL. </p>
  
  <p>A want to persist <strong>User</strong> entity to database <strong>db_example</strong>.</p>
  
  <pre><code>@Entity
  @Table(name = "my_user") // user is a reserved keyword in PostgreSQL
  public class User {
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      private Integer id;  
      private String name;    
      private String email;
  
      // getters and setters       
  }
  </code></pre>
  
  <p>My <strong>application.properties</strong> is quite standart:</p>
  
  <pre><code>spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
  spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
  
  spring.jpa.hibernate.show-sql=true
  spring.jpa.generate-ddl=true
  spring.jpa.hibernate.ddl-auto=create
  
  spring.datasource.url=jdbc:postgresql://localhost:5432/db_example
  spring.datasource.username=springuser
  spring.datasource.password=ThePassword
  </code></pre>
  
  <p>Is it possible to make database created while Spring Boot Application started?</p>
  
  <p>In my case I got 
  <code>org.postgresql.util.PSQLException: FATAL: database "db_example" does not exist</code></p>