Postgresql 8.4 on Ubuntu - PG_VERSION is missing

Posted on 2011-04-20
Last Modified: 2012-05-11
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?
Question by:R7AF
    LVL 22

    Accepted Solution

    run initdb ?
    LVL 13

    Author Comment

    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
    LVL 22

    Expert Comment

    by:earth man2
    # 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
    LVL 13

    Author Comment

    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

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now