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

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "David Fetter" <david(at)fetter(dot)org>
Cc: "Paolo Victor" <paolovictor(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How do I create a database if I can't connect to it?
Date: 2007-07-27 15:56:36
Message-ID: b42b73150707270856h2cd28464r3e16a2f7e90f5b24@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/27/07, David Fetter <david(at)fetter(dot)org> wrote:
> 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(at)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.

I don't necessarily agree with this advice. I encourage everyone who
is considering serious development with PostgreSQL to become familiar
with the database architecture...there are advantages to compiling
from source yourself if you know what you are doing, and simply
learning how to do it is a good exercise.

I am also very suspicious of the assertion that knowledge of how to
manually invoke initdb is not necessary. While the binary vs source
argument certainly debatable, I would certainly advise every
PostgreSQL dba to memorize the initdb man page for various reasons.
However, there are few reasons to run postgres directly, we normally
rely on pg_ctl for that (but it's still useful to know it can be
done).

anyways, to the OP, you need to connect to one of the default
databases (postgres, or template1) and create one from there...or
invoke the createdb command.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lincoln Yeoh 2007-07-27 16:31:54 Re: ssl connections to postgresql
Previous Message Lincoln Yeoh 2007-07-27 15:54:17 Re: ssl connections to postgresql