morne
morne

Reputation: 4189

psql: FATAL: database "Morne Nel" does not exist

I need to do a report in JasperReports.... besides the point here. Ive been given a existing Postgresql DB to use.

I have installed PostgreSQL and all went great. (except the package update at the end. Cant get past the proxy server)

Ive added the C:\Program Files\PostgreSQL\9.0\bin path the the system path as-well.

When I go to cmd and type psql it propts for a password....

I enter password, because thats the only password I added during instalation.

Then is comes up with psql: FATAL: database "Morne Nel" does not exist

step by step hoe do I import this DB into postgres? PLEASE?

Upvotes: 2

Views: 1641

Answers (1)

Lucas
Lucas

Reputation: 2637

When using psql you have to pass database name, otherwise postgres will try to connect to database matching your user name (that is why it tries to connect to "Morne Nel").

You can use createdb console command to create database first. Here is documentation on that command: http://www.postgresql.org/docs/9.3/static/sql-createdatabase.html

But also you can use pg_restore command right away with --create option passed to create and restore database from dump at once (documentation here: http://www.postgresql.org/docs/9.3/static/app-pgrestore.html).

Try to execute those commands (it is possible that you will have to specify your postgres user and password) and let us know what happened. I cannot write more at the moment as I am not sure what dump format do you have so it would be good to provide that information if you won't manage to use pg_restore successfully.

Upvotes: 4

Related Questions