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

A question about differences between createdb and "create database"

From: Paul Vogel <paul(dot)vogel(at)deadeyesoftware(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: A question about differences between createdb and "create database"
Date: 2006-02-13 19:27:16
Message-ID: (view raw or whole thread)
Lists: pgsql-admin
I have a pg_dump of a database (without autocreation lines)  that I 
tried loading by using the commands:
     createdb -T template0 -U postgres database; psql -U postgres 
database < filename

 I couldn't get it to connect via ODBC.  But when I added the following 
lines in the source file:

    CREATE DATABASE "database" WITH TEMPLATE = template0 ENCODING = 
    ALTER DATABASE "database" OWNER TO postgres;
    \connect "database"

And loaded it with the command "psql -U postgres template1 < fileanme" 
the resultant database worked fine with ODBC.  So something is 
apparently different between the command line "createdb" command and the 
"create database" command.  Has anybody else run into this?  And if so, 
are there any other problems I should be aware of?  Or did I miss an 
option of the "createdb" line?

    PS - I'm currently running PostgreSQL 8.1.2 under Linux Fedora Core 2


pgsql-admin by date

Next:From: Guido BarosioDate: 2006-02-13 20:41:03
Subject: Re: vacuumdb
Previous:From: Jim C. NasbyDate: 2006-02-13 17:46:31
Subject: Re: vacuumdb

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