diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2001-03-13 21:37:15 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2001-03-13 21:37:15 +0000 |
commit | f192da1ba3da18dada3bd1d9030323b64f31ccb4 (patch) | |
tree | b48e1463b922eec154f31e8c140d3fe43cd916ce /src | |
parent | 253c8fecfb2bc8075229366623e80d5579cba8c1 (diff) | |
download | postgresql-f192da1ba3da18dada3bd1d9030323b64f31ccb4.tar.gz postgresql-f192da1ba3da18dada3bd1d9030323b64f31ccb4.zip |
Provide more useful error message if 'postgres -V' failed. Advertise
pg_ctl '-l' option.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/initdb/initdb.sh | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh index c526b0b8fea..1653987f739 100644 --- a/src/bin/initdb/initdb.sh +++ b/src/bin/initdb/initdb.sh @@ -23,7 +23,7 @@ # Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.121 2001/02/18 18:33:59 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.122 2001/03/13 21:37:15 petere Exp $ # #------------------------------------------------------------------------- @@ -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 |