Обсуждение: n00b question: createdb seeming to fail quietly on new ubuntu 9.1 installation

Поиск
Список
Период
Сортировка

n00b question: createdb seeming to fail quietly on new ubuntu 9.1 installation

От
Wells Oliver
Дата:
Just did an install via apt-get of 8.4 and ... well ... I was able to set the password for the postgres user, then I log in and type:

createdb test

It goes quietly, which according to the documentation is a success, but...

\l doesn't show the database. Nor does /var/log/postgresql/postgresql-8.4-main.log indicate any issue.

Secondly, adding a user seems to work, but I can't create the DB for the user (same issue as above). Any tips? Anything I can look at? This is a brand spanking new fresh 8.4 installation using the packages included in the 9.1 ubuntu packages.

Thanks!

--
Wells Oliver
wells@submute.net

Re: n00b question: createdb seeming to fail quietly on new ubuntu 9.1 installation

От
Scott Marlowe
Дата:
On Mon, Apr 19, 2010 at 5:14 PM, Wells Oliver <wells@submute.net> wrote:
> Just did an install via apt-get of 8.4 and ... well ... I was able to set
> the password for the postgres user, then I log in and type:
>
> createdb test

Is that from a command line that looks like this:

smarlowe@steamboat:/$

or this:

Welcome to psql 8.3.9, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

smarlowe=#

from the first one, createdb will work.  From the second it's:

create database test;

(notice the ; which terminates the line and executes the SQL) ?

> It goes quietly, which according to the documentation is a success, but...
>
> \l doesn't show the database. Nor does
> /var/log/postgresql/postgresql-8.4-main.log indicate any issue.

Yeah, I'm betting you're in the psql monitor.  createdb is a command
line command and it won't work from there.  The psql monitor is silent
until it gets a command, which is terminated with ;.

> Secondly, adding a user seems to work, but I can't create the DB for the
> user (same issue as above). Any tips? Anything I can look at? This is a
> brand spanking new fresh 8.4 installation using the packages included in the
> 9.1 ubuntu packages.

Got an error message?  Also, it's 9.10, not 9.1.  The numbers
represent the year / month of the release, hence 9.10, not 9.1.