• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3116
  • Last Modified:

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?
  • 2
  • 2
1 Solution
earth man2Commented:
run initdb ?
R7AFAuthor Commented:
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
earth man2Commented:
# 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
R7AFAuthor Commented:
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now