Re: createdb: could not connect

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "stephenc" <mail(at)xesoftware(dot)com(dot)au>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: createdb: could not connect
Date: 2007-03-25 20:13:21
Message-ID: 16959.1174853601@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"stephenc" <mail(at)xesoftware(dot)com(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tim Bowden 2007-03-26 11:56:54 ER diagrams
Previous Message stephenc 2007-03-25 19:35:30 createdb: could not connect