How to set up PostgreSQL for Play 2.0? How to set up PostgreSQL for Play 2.0? postgresql postgresql

How to set up PostgreSQL for Play 2.0?


Most probably this is the problem:

db.default.url="postgres://play:play@localhost:9000/Play_Playground_DB"

The play doku says, "db.default.url" is a plain JDBC-URL. There are two problems with your value:

  • It is not in a format recognized by PostgreSQL. Look here for allowed formats.
  • With ...default... you redefine the default datasource. By default this calls for trouble unless you do some more steps.

A valid PostgreSQL URL might look like this in your case:

jdbc:postgresql://localhost:9000/Play_Playground_DB

But:_ Are sure your database is running on port 9000? You say psql Play_Playground_DB works for you. Therefore I think your port should be the default port 5432. Then this URL is the right one:

jdbc:postgresql://localhost/Play_Playground_DB


On my OSX, I've installed PostgreSQL from homebrew and current version is 9.3.4

The connection strings described above do not work for me because they are using postresql database name. My connections are established if and only if I specify like:

db.default.url="postgres://user:password@localhost/MyDbName"

Notice that it is postgres instead of postgresql.