Re: createdb: could not connect - Mailing list pgsql-novice

From Tom Lane
Subject Re: createdb: could not connect
Date
Msg-id 16959.1174853601@sss.pgh.pa.us
Whole thread Raw
In response to createdb: could not connect  ("stephenc" <mail@xesoftware.com.au>)
List pgsql-novice
"stephenc" <mail@xesoftware.com.au> writes:
> postgres=# makedb mydb
> postgres-#

The reason that doesn't work is that (1) makedb is not a SQL command
in Postgres, and (2) since you didn't type a semicolon, psql thinks
the command is incomplete and is waiting for you to type another line
of command.  You would have gotten a syntax error when you did enter
a semicolon, because the right command syntax is "CREATE DATABASE mydb;"

> I think this is something to do with the password, but now I am lost.  Can
> someone tell me how to set the password?  Incidentally, I never created a
> user stephenc.  That is just the name of my user account on the xp box.

You seem to be able to get into psql OK, so it's not clear to me why
createdb didn't work.  Perhaps you specified a -U option to psql but
forgot it for createdb?

            regards, tom lane

pgsql-novice by date:

Previous
From: "stephenc"
Date:
Subject: createdb: could not connect
Next
From: Tim Bowden
Date:
Subject: ER diagrams