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

From: "Paolo Victor" <paolovictor(at)gmail(dot)com>
To: 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 17:20:26
Message-ID: f8c46d190707271020j585569efw5d3955e60ba46890@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

First: Thanks for all the advice!

David:

I tried installing the system's packages, but as I plan using the python
procedures feature, I've got to compile it with the "--with-python" option.
I'm not sure if the default package already includes the feature, but since
the createlang command failed and I found out on some forum (sorry, I lost
the link) that I had to compile PG with this option set, I tried compiling
PG myself.

Oh, and I've already compiled PG before (but without the python option) and
had no problems. I'm trying to compile the 8.2.4 version, I'll try with
8.2.3.

Scott, Merlin:

When I try to connect to one of the default databases, here's what I get:

paolo(at)box:~$ psql -d template1 -p 5435
NOTICE: table "pg_class" was reindexed
NOTICE: table "sql_sizing" was reindexed
NOTICE: table "sql_sizing_profiles" was reindexed
NOTICE: table "sql_features" was reindexed
NOTICE: table "sql_implementation_info" was reindexed
NOTICE: table "sql_languages" was reindexed
NOTICE: table "sql_packages" was reindexed
NOTICE: table "sql_parts" was reindexed
NOTICE: table "pg_statistic" was reindexed
NOTICE: table "pg_type" was reindexed
NOTICE: table "pg_attribute" was reindexed
NOTICE: table "pg_proc" was reindexed
NOTICE: table "pg_autovacuum" was reindexed
NOTICE: table "pg_attrdef" was reindexed
NOTICE: table "pg_constraint" was reindexed
NOTICE: table "pg_inherits" was reindexed
NOTICE: table "pg_index" was reindexed
NOTICE: table "pg_operator" was reindexed
NOTICE: table "pg_opclass" was reindexed
NOTICE: table "pg_am" was reindexed
NOTICE: table "pg_amop" was reindexed
NOTICE: table "pg_amproc" was reindexed
NOTICE: table "pg_language" was reindexed
NOTICE: table "pg_largeobject" was reindexed
NOTICE: table "pg_aggregate" was reindexed
NOTICE: table "pg_rewrite" was reindexed
NOTICE: table "pg_trigger" was reindexed
NOTICE: table "pg_description" was reindexed
NOTICE: table "pg_cast" was reindexed
NOTICE: table "pg_namespace" was reindexed
NOTICE: table "pg_conversion" was reindexed
NOTICE: table "pg_depend" was reindexed
REINDEX

I get the same output when I execute the createuser command.

On 7/27/07, Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:
>
> 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 Joshua D. Drake 2007-07-27 17:23:17 PostgreSQL, PGDAY, PGParty and OSCON 2007 Rocked!
Previous Message mwsenecal 2007-07-27 16:33:37 Require entry of MD5 hash instead of plaintext password?