postgresql 9.2 don't run

urgido

Well-Known Member
Jul 19, 2005
129
10
168
cPanel Access Level
Root Administrator
Hi guys
I tried to run postgresql 9.2 but I don't have luck

Code:
[[email protected] lib]# service postgresql-9.2 initdb
Initializing database: mkdir: cannot create directory `/var/lib/pgsql/9.2/data/pg_log': File exists
                                                           [FAILED]
I am on CentOS release 6.5 (Final) x86_64 x86_64 x86_64 GNU/Linux

Any clue?
Thank you!!!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

What method did you use to install PostgreSQL?

Thank you.
 

urgido

Well-Known Member
Jul 19, 2005
129
10
168
cPanel Access Level
Root Administrator
If I try to reinstall I got this:

[[email protected] ~]# /scripts/installpostgres
This script will install PostgreSQL 7.4.x or later
If you have an older version installed you wil need to
Dump your databases to a file and then restore them
after the install as 7.4.x is not backwards compatible.
If you do not have any databases, you can just run:
mv /var/lib/pgsql /var/lib/pgsql.old
/sbin/service postgresql stop
/sbin/service postgresql start
to force creating a 7.4.x style setup. Do not do this if
you have databases that you wish to keep!

Are you sure you wish to proceed? y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.ash.fastserv.com
* elrepo: repos.mia.lax-noc.com
* extras: mirrors.centarra.com
* rpmforge: repoforge.mirror.constant.com
* updates: repo.dimenoc.com
Setting up Install Process
No package rh-postgresql available.
No package rh-postgresql-devel available.
No package rh-postgresql-libs available.
No package rh-postgresql-server available.
Package postgresql92-9.2.9-1PGDG.rhel6.x86_64 already installed and latest version
Package postgresql92-devel-9.2.9-1PGDG.rhel6.x86_64 already installed and latest version
Package postgresql92-libs-9.2.9-1PGDG.rhel6.x86_64 already installed and latest version
Package postgresql92-server-9.2.9-1PGDG.rhel6.x86_64 already installed and latest version
Nothing to do
info [installpostgres] Prelinking shared libraries and binaries: /usr/sbin/prelink -av -mR
Failed to determine postgresql data directory
PostgreSQL users created


The PostgreSQL packages have been installed successfully. To configure,
navigate to WHM's Postgres Config feature where you can set your password
and enable PostgreSQL functionality for existing user accounts.

Setting random password for postgres database user
warn [cpsessetup] Failed to create: Cpanel::Cpses::Setup::Postgres: pgsql data directory not found at /usr/local/cpanel/Cpanel/Cpses/Setup/Postgres.pm line 31.
 

urgido

Well-Known Member
Jul 19, 2005
129
10
168
cPanel Access Level
Root Administrator
Now, this is what i got
[[email protected] data]# /scripts/restartsrv postgresql
waiting for postgresql to restart...............initdb: No data directory specified
you must identify the directory where the data for this database system
will reside. Do this with either the invocation option -d or the
environment variable pgdata.
Finished.

Postgres database is not initialized...initializing it...done

initdb: No data directory specified
you must identify the directory where the data for this database system
will reside. Do this with either the invocation option -d or the
environment variable pgdata.
Postgresql has failed, please contact the sysadmin (result was "postgres database is not initialized...initializing it...done, postmaster is not running").
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
The cPanel installer that's supported is going to install an earlier version of PostgreSQL. Is that what you want? If so, please ensure you undo the custom changes you made when attempting to install the newer version before proceeding.

Thank you.