From: Peter Eisentraut Date: Tue, 13 Mar 2001 21:37:15 +0000 (+0000) Subject: Provide more useful error message if 'postgres -V' failed. Advertise X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=9ef4f857e256dabed317dcaad01f9a8a6d70ae39;p=users%2Fbernd%2Fpostgres.git Provide more useful error message if 'postgres -V' failed. Advertise pg_ctl '-l' option. --- diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh index 4c4efb08da..4a23d7337a 100644 --- a/src/bin/initdb/initdb.sh +++ b/src/bin/initdb/initdb.sh @@ -117,8 +117,19 @@ elif [ -x "$bindir/postgres" ]; then then PGPATH=$bindir else - echo "The program '$bindir/postgres' needed by $CMDNAME does not belong to" 1>&2 - echo "PostgreSQL version $VERSION. Check your installation." 1>&2 + # 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 @@ -638,9 +649,11 @@ echo "VACUUM pg_database" \ echo echo "Success. You can now start the database server using:" echo "" -echo " $PGPATH/postmaster -D $PGDATA" +echo " $PGPATH/postmaster -D $PGDATA" echo "or" -echo " $PGPATH/pg_ctl -D $PGDATA start" +# (Advertise -l option here, otherwise we have a background +# process writing to the terminal.) +echo " $PGPATH/pg_ctl -D $PGDATA -l logfile start" echo exit 0