aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas G. Lockhart <lockhart@fourpalms.org>1998-08-14 16:05:51 +0000
committerThomas G. Lockhart <lockhart@fourpalms.org>1998-08-14 16:05:51 +0000
commit58e9267026a5fb9217d6231349c55f8b1c745b48 (patch)
tree0e6d7c2953791f62d04c0848af25a29d062aa491 /src
parentc7fe2543b8cabf0df2186e9676052c87d26a0f44 (diff)
downloadpostgresql-58e9267026a5fb9217d6231349c55f8b1c745b48.tar.gz
postgresql-58e9267026a5fb9217d6231349c55f8b1c745b48.zip
Check for bad result from pg_id. A bad result can come from shared library
trouble, and the name of the shared library has been changed recently. Had to rerun ldconfig on my machine to get it working again. Give an error message with a helpful hint if so...
Diffstat (limited to 'src')
-rw-r--r--src/bin/initdb/initdb.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh
index 94c815d8e4c..2c16006209b 100644
--- a/src/bin/initdb/initdb.sh
+++ b/src/bin/initdb/initdb.sh
@@ -26,7 +26,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.45 1998/08/01 22:57:41 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.46 1998/08/14 16:05:51 thomas Exp $
#
#-------------------------------------------------------------------------
@@ -240,6 +240,14 @@ fi
POSTGRES_SUPERUID=`pg_id $POSTGRES_SUPERUSERNAME`
+if [ ${POSTGRES_SUPERUID:=-1} -eq -1 ]; then
+ echo "Unable to determine a valid username. If you are running"
+ echo "initdb without an explicit username specified, then there"
+ echo "may be a problem with finding the Postgres shared library"
+ echo "and/or the pg_id utility."
+ exit 10
+fi
+
if [ $POSTGRES_SUPERUID = NOUSER ]; then
echo "Valid username not given. You must specify the username for "
echo "the Postgres superuser for the database system you are "
@@ -274,7 +282,7 @@ if [ -f "$PGDATA/PG_VERSION" ]; then
echo "database system already exists."
echo
echo "If you want to create a new database system, either remove "
- echo "the $PGDATA directory or run initdb with a --pgdata option "
+ echo "the directory $PGDATA or run initdb with a --pgdata option "
echo "other than $PGDATA."
exit 1
fi