Reworked the postgresql database creation.