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

Re: Starting psql without a database?

From: "Fred Parkinson" <FredP(at)abag(dot)ca(dot)gov>
To: <pgsql-admin(at)postgresql(dot)org>, "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Subject: Re: Starting psql without a database?
Date: 2011-04-27 19:44:51
Message-ID: (view raw or whole thread)
Lists: pgsql-admin
Right you are!  'CREATE DATABASE' worked (started psql with the postgres database) where createdb didn't.
Was there some way to tell from the documentation that createdb is to run from the shell while CREATE DATABASE is run from the psql prompt?   I assumed all database-related commands are run from the psql prompt.
Thanks again, Fred

>>> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> 04/27/2011 11:51 AM >>>
"Fred Parkinson" <FredP(at)abag(dot)ca(dot)gov> wrote:

> I tried using the database 'postgres' which seems to be created
> during the install:
> psql postgres, which takes me to a psql prompt.  However, the
> command createdb -T DEFAULT "timecard" now results in the error
> "syntax error at or neat "createdb" with a carat pointing to the
> 'c' in 'createdb'.

I think you're confusing the OS command-line executable createdb:

and the SQL command CREATE DATABASE:


In response to


pgsql-admin by date

Next:From: Kevin GrittnerDate: 2011-04-27 20:05:21
Subject: Re: Starting psql without a database?
Previous:From: Bob LunneyDate: 2011-04-27 19:37:48
Subject: Re: best practice for moving millions of rows to child table when setting up partitioning?

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