pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fred Parkinson <FredP@abag.ca.gov>
To: pgsql-admin@postgresql.org
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Subject: Re: Starting psql without a database?
Date: Wed, 27 Apr 2011 12:44:51 -0700
Message-ID: <4DB80FC3020000A70001701D@gwia1.abag.ca.gov> (raw)
In-Reply-To: <4DB81F4E020000250003CF57@gw.wicourts.gov>
References: <4DB7EF0B020000A700017002@gwia1.abag.ca.gov>
	<4DB801AD020000A700017012@gwia1.abag.ca.gov>
	<4DB801AD020000A700017012@gwia1.abag.ca.gov>
	<4DB81F4E020000250003CF57@gw.wicourts.gov>

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.Grittner@wicourts.gov> 04/27/2011 11:51 AM >>>
"Fred Parkinson" <FredP@abag.ca.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:

http://www.postgresql.org/docs/9.0/interactive/app-createdb.html

and the SQL command CREATE DATABASE:

http://www.postgresql.org/docs/9.0/interactive/sql-createdatabase.html

-Kevin

view thread (5+ messages)  latest in thread

Message-ID: <4DB80FC3020000A70001701D@gwia1.abag.ca.gov>
Permalink:  ../4DB80FC3020000A70001701D@gwia1.abag.ca.gov/
Also on:    postgresql.org/message-id/4DB80FC3020000A70001701D@gwia1.abag.ca.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: FredP@abag.ca.gov, Kevin.Grittner@wicourts.gov
  Subject: Re: Starting psql without a database?
  In-Reply-To: <4DB80FC3020000A70001701D@gwia1.abag.ca.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox