Re: How do I create a database if I can't connect to it?

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: How do I create a database if I can't connect to it?
Дата
Msg-id 20070727151952.GC26973@fetter.org
обсуждение исходный текст
Ответ на How do I create a database if I can't connect to it?  ("Paolo Victor" <paolovictor@gmail.com>)
Ответы Re: How do I create a database if I can't connect to it?  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-general
On Fri, Jul 27, 2007 at 11:28:58AM -0300, Paolo Victor wrote:
> Hello,
>
> For a short description, I'll just show the sequence of commands I'm trying
> to execute:
>
> paolo@box> initdb -D /usr/local/pgsql/data/

This looks like a mistake.  Unless you plan to develop the PostgreSQL
code itself, you should not be installing from source.  Instead, you
should be using one from the packaging system your operating system
uses.

> paolo@box> postgres -D /usr/local/pgsql/data -i -p 5435
> paolo@box> createdb foo -p 5435
> createdb: could not connect to database foo: FATAL:  database "foo" does not
> exist
>
> And
>
> "postgres -D /usr/local/pgsql/data -i -p 5435"'s output:
>
> /*
> LOG:  database system was shut down at 2007-07-27 11:25:27 BRT
> LOG:  checkpoint record is at 0/42C4B4
> LOG:  redo record is at 0/42C4B4; undo record is at 0/0; shutdown TRUE
> LOG:  next transaction ID: 0/593; next OID: 10820
> LOG:  next MultiXactId: 1; next MultiXactOffset: 0
> LOG:  database system is ready
> FATAL:  database "foo" does not exist
> */

> Now, am I doing something terribly wrong/noobish, or Postgres is freaking
> out because I want to create a database that does not exist?

It's freaking out because you are not the postgres user it expects
when trying to connect with createdb.  It expects you to be the
postgres user, not the foo user.  Your best move would be to wipe this
and reinstall using your OS's packages.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!
Consider donating to PostgreSQL: http://www.postgresql.org/about/donate

В списке pgsql-general по дате отправления:

Предыдущее
От: "Paolo Victor"
Дата:
Сообщение: How do I create a database if I can't connect to it?
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: How do I create a database if I can't connect to it?