Link to home
Start Free TrialLog in
Avatar of R7AF
R7AFFlag for Netherlands

asked on

Postgresql 8.4 on Ubuntu - PG_VERSION is missing

I want to get PostgreSQL 8.4 running on Ubuntu 10.10 (64bit desktop). I've installed postgres via Synaptic, tried to get it configured, but I can't get it working.

When I run this command:

./pg_ctl start -D /usr/share/postgresql/8.4/DATA

I get this error message:

FATAL: "/usr/share/postgresql/8.4/DATA" is not a valid data directory
DETAIL: File "/usr/share/postgresql/8.4/DATA/PG_VERSION" is missing.

The directory /usr/share/postgresql/8.4/DATA exists with owner postgres, but there is no PG_VERSION file in it.

How can I get Postgres working?
ASKER CERTIFIED SOLUTION
Avatar of earth man2
earth man2
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of R7AF

ASKER

Thanks. I can run it in the terminal now, but after a restart it doesn't run.

In /etc/rc2.d I see the following two symlinks. I thought this would make postgresql run at startup. Do I need to do something else?

lrwxrwxrwx   1 root root    20 2010-10-14 12:59 S19postgresql -> ../init.d/postgresql
lrwxrwxrwx   1 root root    24 2010-05-25 16:42 S19postgresql-8.4 -> ../init.d/postgresql-8.4
# as root
chkconfig postgresql on

# will set service postgresql to start automatically on reboot

# the command
service postgresql start
# will manually start the postgresql service
Avatar of R7AF

ASKER

I installed chkconfig and ran the command. After a restart, postgres didn't run. When I use the command "service postgresql start", nothing happens, not even a comment or error message.

Postgresql does start when I use the following command.

/usr/lib/postgresql/8.4/bin/postgres -D /usr/share/postgresql/8.4/DATA