Thread: Installing Postgres w/RH9

Installing Postgres w/RH9

From
Lynn.Tilby@asu.edu
Date:
I just installed RH9 on a new machine and installed postgres in the
installation process.  I got the following error when trying to
start the postmaster so... I tried removing the postgres software
then reinstalling.  rpm first said the software was not installed
then when I tried to reinstall rpm said it was already installed.

How do I solve this problem?

Thanks for your help!
Lynn


-bash-2.05b$ postmaster&
[1] 3139
-bash-2.05b$ FATAL:  File /var/lib/pgsql/data/PG_VERSION is missing. This is not
a valid data directory.

[1]+  Exit 1                  postmaster
-bash-2.05b$


[root@regulus root]# cd /var/lib/pgsql
[root@regulus pgsql]# for i in `ls postgresql*.rpm`; do rpm -e $i; done
error: package postgresql72-libs-1-3.i386.rpm is not installed
error: package postgresql-7.3.2-3.i386.rpm is not installed
error: package postgresql-contrib-7.3.2-3.i386.rpm is not installed
error: package postgresql-devel-7.3.2-3.i386.rpm is not installed
error: package postgresql-docs-7.3.2-3.i386.rpm is not installed
error: package postgresql-jdbc-7.3.2-3.i386.rpm is not installed
error: package postgresql-libs-7.3.2-3.i386.rpm is not installed
error: package postgresql-odbc-7.2.5-1.i386.rpm is not installed
error: package postgresql-pl-7.3.2-3.i386.rpm is not installed
error: package postgresql-python-7.3.2-3.i386.rpm is not installed
error: package postgresql-server-7.3.2-3.i386.rpm is not installed
error: package postgresql-tcl-7.3.2-3.i386.rpm is not installed
error: package postgresql-test-7.3.2-3.i386.rpm is not installed
[root@regulus pgsql]# for i in `ls postgresql*.rpm`; do rpm -i $i; done
warning: postgresql72-libs-1-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
        package postgresql72-libs-1-3 is already installed
warning: postgresql-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
        package postgresql-7.3.2-3 is already installed
warning: postgresql-contrib-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID
db42a60e
        package postgresql-contrib-7.3.2-3 is already installed
warning: postgresql-devel-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
        package postgresql-devel-7.3.2-3 is already installed
warning: postgresql-docs-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
        package postgresql-docs-7.3.2-3 is already installed
warning: postgresql-jdbc-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
        package postgresql-jdbc-7.3.2-3 is already installed
warning: postgresql-libs-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
        package postgresql-libs-7.3.2-3 is already installed
warning: postgresql-odbc-7.2.5-1.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
        package postgresql-odbc-7.2.5-1 is already installed
warning: postgresql-pl-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
        package postgresql-pl-7.3.2-3 is already installed
warning: postgresql-python-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID
db42a60e
        package postgresql-python-7.3.2-3 is already installed
warning: postgresql-server-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID
db42a60e
        package postgresql-server-7.3.2-3 is already installed
warning: postgresql-tcl-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
        package postgresql-tcl-7.3.2-3 is already installed
warning: postgresql-test-7.3.2-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
        package postgresql-test-7.3.2-3 is already installed
[root@regulus pgsql]#


Re: Installing Postgres w/RH9

From
"Roderick A. Anderson"
Date:
On Tue, 23 Dec 2003 Lynn.Tilby@asu.edu wrote:

> I just installed RH9 on a new machine and installed postgres in the
> installation process.  I got the following error when trying to
> start the postmaster so... I tried removing the postgres software
> then reinstalling.  rpm first said the software was not installed
> then when I tried to reinstall rpm said it was already installed.

I've seen this happen but never been able to figure out exactly what
caused it.

> How do I solve this problem?

First navigate to /var/lib/rpm and remove the three files that begin with
double underscores typically named __db.001, __db.002, and __db.003

When trying to remove packages I use the rpm -qa | grep xxx to determine
the actual package names.  If, like the case of PostgreSQL, they are all
lumped together with a naming that is common to all the packages I use
this

    rpm -e $(rpm -qa | grep postgres)

and nuke them all.

Also make sure that you have stopped the postmaster (PostgreSQL) before
trying to remove the packages.  /etc/init.d/postgresql stop


Good luck to you.
Rod
--
    "Open Source Software - You usually get more than you pay for..."
     "Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"



Re: Installing Postgres w/RH9

From
Tom Lane
Date:
Lynn.Tilby@asu.edu writes:
> -bash-2.05b$ postmaster&
> [1] 3139
> -bash-2.05b$ FATAL:  File /var/lib/pgsql/data/PG_VERSION is missing. This is not
> a valid data directory.

You haven't run initdb, or at least haven't run it in that PGDATA
directory.  If you think that the rpm package installation process
should have run initdb (I honestly don't know whether it would or not),
then check to see if your PGDATA setting agrees with the package docs.


> [root@regulus pgsql]# for i in `ls postgresql*.rpm`; do rpm -e $i; done
> error: package postgresql72-libs-1-3.i386.rpm is not installed
> ...
> [root@regulus pgsql]# for i in `ls postgresql*.rpm`; do rpm -i $i; done
> warning: postgresql72-libs-1-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
>         package postgresql72-libs-1-3 is already installed

I'm pretty sure that "rpm -e" wants just the bare package name, without
any ".rpm" extension.  As somebody else noted, looking at the output of
"rpm -qa" is the most reliable way to get the names of your installed
packages.

            regards, tom lane

Re: Installing Postgres w/RH9

From
Martin Marques
Date:
El Jue 25 Dic 2003 13:02, Tom Lane escribió:
> Lynn.Tilby@asu.edu writes:
> > -bash-2.05b$ postmaster&
> > [1] 3139
> > -bash-2.05b$ FATAL:  File /var/lib/pgsql/data/PG_VERSION is missing. This
is not
> > a valid data directory.
>
> You haven't run initdb, or at least haven't run it in that PGDATA
> directory.  If you think that the rpm package installation process
> should have run initdb (I honestly don't know whether it would or not),
> then check to see if your PGDATA setting agrees with the package docs.

The problem is that he's trying to start the postmaster form the comand line,
executing it directly.

Lynn, if you installed PostgreSQL from the rpms that come with RH9 (or Lamars
rpms) just try starting PostgreSQL from the init script:

# /etc/init.d/postgresql start

That script will run initdb if necesary, and set the PGDATA environment
variable if needed also.

Good luck!

--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-----------------------------------------------------------------
Martín Marqués                  |        mmarques@unl.edu.ar
Programador, Administrador, DBA |       Centro de Telemática
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------


Re: Installing Postgres w/RH9

From
Lynn.Tilby@asu.edu
Date:
Thanks for all the help guys.  This problem is solved...
Lynn

Quoting Martin Marques <martin@bugs.unl.edu.ar>:

> El Jue 25 Dic 2003 13:02, Tom Lane escribió:
> > Lynn.Tilby@asu.edu writes:
> > > -bash-2.05b$ postmaster&
> > > [1] 3139
> > > -bash-2.05b$ FATAL:  File /var/lib/pgsql/data/PG_VERSION is missing.
> This
> is not
> > > a valid data directory.
> >
> > You haven't run initdb, or at least haven't run it in that PGDATA
> > directory.  If you think that the rpm package installation process
> > should have run initdb (I honestly don't know whether it would or
> not),
> > then check to see if your PGDATA setting agrees with the package
> docs.
>
> The problem is that he's trying to start the postmaster form the comand
> line,
> executing it directly.
>
> Lynn, if you installed PostgreSQL from the rpms that come with RH9 (or
> Lamars
> rpms) just try starting PostgreSQL from the init script:
>
> # /etc/init.d/postgresql start
>
> That script will run initdb if necesary, and set the PGDATA environment
>
> variable if needed also.
>
> Good luck!
>
> --
> select 'mmarques' || '@' || 'unl.edu.ar' AS email;
> -----------------------------------------------------------------
> Martín Marqués                  |        mmarques@unl.edu.ar
> Programador, Administrador, DBA |       Centro de Telemática
>                        Universidad Nacional
>                             del Litoral
> -----------------------------------------------------------------
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>