14

Well I installed the latest postgreql database on my Windows 7.

Now I'm trying to create a database via the psql.exe command line

When I open it, it says

psql: FATAL: database "Jansu" does not exist

So I read somewhere, that when no database is specified, it tried to find database with my username or something.

Anyways..how do i create a new database, when I can't access the commandline.

asked Apr 20, 2011 at 19:08

1 Answer 1

26

Read psql syntax. You can specify database, user and other parameters. If it's a new installation, there should be a default database 'postgres', you can connect to that one.

 psql -U postgres postgres 

(In Unix environments you might need to add -h localhost in order to force a TCP connection, otherwise it'd try to use Unix-domain sockets, which might not work for other than the postgres user. )

You can create databases from there, or from the command line with createdb

answered Apr 20, 2011 at 20:04

5 Comments

psql: FATAL: Ident authentication failed for user "postgres"
psql: FATAL: Peer authentication failed for user "postgres"
If I may add, psql -U postgres postgres -h localhost
@Frankline : that should not be necessary in Windows

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.