Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

Next:From: Tim BowdenDate: 2007-03-26 11:56:54
Subject: ER diagrams
Previous:From: stephencDate: 2007-03-25 19:35:30
Subject: createdb: could not connect

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group