Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@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@xxxxxxxxx > wrote:
On 7/27/07, David Fetter <david@xxxxxxxxxx > 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@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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux