How to initialize postgres instance under linux ?

Posted on 2005-05-10
Last Modified: 2008-03-10

I am new to postgres setup, Actually i am trying to run my ESQL application and test it under red hat linux.
I am trying to initialize the local postgres instance in single user mode.

When i ran

initdb -D /home/aaa/db

it produces following error:

creating directory /home/aaa/db... ok
creating directory /home/aaa/db/base... ok
creating directory /home/aaa/db/global... ok
creating directory /home/aaa/db/pg_xlog... ok
creating directory /home/aaa/db/pg_clog... ok
creating configuration files... ok
creating template1 database in /home/aaa/db/base/1...
initdb: failed
initdb: removing data directory "/home/aaa/db"

Even when i have created the directory and ran above command it is producing the same error.

I don't understand actually what is the problem, i have to start this instance. Can any one please let me know what is the problem and how can i resolve this issue ?
Question by:kumarv2
    LVL 22

    Expert Comment

    by:earth man2
    try the following

    ensure you have enough room on your disk partition !

    as user postgres issue the following commands

    initdb --help

    initdb --noclean --debug -D /home/aaa/db

    Author Comment

    Tried this as well, but nothing much of helpful. I still in a same place. It shows the same error. Space provided is also sufficient. Running in the debug has provided few more options and noclean offcourse didn't clean the messages.

    I don't understand why it is not able to create the template1 database cluster.
    Could you please help me to make this work.
    LVL 22

    Accepted Solution

    You probably have not installed postgresql correctly.   Either there is machine code there that is not compatible with your
    cpu or there is a library incompatibility.

    Get a source tarball.

    tar jxvf postgresql-8.0.2.tar.bz2
    cd  postgresql-8.0.2
    ./configure --prefix=/usr --with-gnu-ld --with-openssl --with-perl --with-python --enable-nls

    as root
    make install

    as user postgres
    initdb -D /home/aaa/db

    Author Comment

    I had the problem with the postgres, i got to know the problem while discussing here in this site. I am able to resolve the issue now and it is working fine for me now. Thanks

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: ( This requires some add-o…
    Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
    Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    734 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

    24 Experts available now in Live!

    Get 1:1 Help Now