Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie install problem

Status
Not open for further replies.

paladin256

Technical User
Apr 16, 2002
189
US
I am runing Solaris 9 Sparc. I have ran the configure, make, make check, makeinstall and allwent well. I then su to the user postgres and try to run the next command bin/initdb -D /
I get the following error
The program
'/needed by initdb does not belong to PostgreSQL version 7.2.2, or
there may be a configuration problem.

This was the error message issued by that program:
ld.so.1: / fatal: libreadline.so.4: open failed: No such file or directory
 
Hi paladin256,

Before building your template1 database with the initdb command make sure postgres is not running.

If you are installing a new version at the same location as the old version of postgres, then shut down the old server, at the latest before you install the new files:

kill -INT `cat /


On systems that have postgres started at boot time, there is probably a stat-up file that will accomplish the same thing. For example on my RedHat Linux system I find that:


/etc/rc.d/init.d/postgresql stop

works. Another possiblility is:


pg_ctl stop


After you have installed Postgres, create a new database directory and start the new server. Remember that you must execute these commands while logged in to the special database user account. On my RedHat Linux the db user is named postgres and when I log in I am place in the home direcory of:


/var/lib/pgsql


I assume this would correspond to your:


/ directory


To create the new ./data directory and template1 database:


/ -D /usr/


Warning: Do a search of your system to make sure where the dbinit bianry is and adjust your path accordingly. On my RedHat Linux system dbinit is placed in /usr/bin directory which is in the postgres env path so all I have to do is:


dbinit -D /var/lib/psgrg/data


Finally, start postgres:


/ -D /



Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Hi paladin256,

I went back and read my post. Several places I wrote dbinit when I should have written initbd. Also, I referred to you postgres sql home directory as /usr/ when I should have referred to it as /
Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
I have checked and postgresql is not running and I still am getting the same error. Also as a side note this is a new install I have never installed postgresql on this box before.
 
Hi paladin256,

I took a look at initdb bash sh script and have included the portion of the script where initdb is failing:


------------------- Begin Portion of initdb--------------

# Check for right version of backend. First we check for an
# executable in the same directory is this initdb script (presuming
# the above code worked). Then we fall back to the hard-wired bindir.
# We do it in this order because during upgrades users might move
# their trees to backup places, so $bindir might be inaccurate.

if [ x"$self_path" != x"" ] && [ -x "$self_path/postgres" ] && [ x"`$self_path/postgres -V 2>/dev/null`" = x"postgres (PostgreSQL) $VERSION" ]
then
PGPATH=$self_path
elif [ -x "$bindir/postgres" ]; then
if [ x"`$bindir/postgres -V 2>/dev/null`" = x"postgres (PostgreSQL) $VERSION" ]
then
PGPATH=$bindir
else
# Maybe there was an error message?
errormsg=`$bindir/postgres -V 2>&1 >/dev/null`
(
echo "The program "
echo " '$bindir/postgres'"
echo "needed by $CMDNAME does not belong to PostgreSQL version $VERSION, or"
echo "there may be a configuration problem."
if test x"$errormsg" != x""; then
echo
echo "This was the error message issued by that program:"
echo "$errormsg"
fi
) 1>&2
exit 1
fi
else
echo "The program 'postgres' is needed by $CMDNAME but was not found in" 1>&2
echo "the directory '$bindir'. Check your installation." 1>&2
exit 1
fi
------------------ End Portion of initdb ---------------


It appear that the script is not finding the postgres executable and you initdb command is using the wrong paths. The script then fall back to the $binddir (e.g. this is the directory in which initdb live), and it is not finding the postgres executable their either. Therefore it has no way to verify for the version os postgres.

You might do a seach of you directory to find where postgres lives and adjust your paths accordingly. Also, you might use your editor of choice to open up initdb to look under the hood, if you have any other problems. Initdb is a script written in bash sh.

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top