Allow initdb to handle relative paths for PGDATA, by converting them to
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 2 Nov 2000 19:48:39 +0000 (19:48 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 2 Nov 2000 19:48:39 +0000 (19:48 +0000)
absolute before starting a backend.

src/bin/initdb/initdb.sh

index ceda595e2c3a258efb481442b44ff221d04f1017..057e62a568942a42849d5cbe91442ef746606a55 100644 (file)
@@ -321,16 +321,6 @@ then
     exit 1
 fi
 
-# The data path must be absolute, because the backend doesn't like
-# '.' and '..' stuff. (Should perhaps be fixed there.)
-
-echo "$PGDATA" | grep '^/' > /dev/null 2>&1
-if [ "$?" -ne 0 ]
-then
-    echo "$CMDNAME: data path must be specified as an absolute path"
-    exit 1
-fi
-
 
 #-------------------------------------------------------------------------
 # Find the input files
@@ -434,6 +424,11 @@ else
     fi
 fi
 
+# Be sure that PGDATA is an absolute path, otherwise backend croaks.
+
+unset CDPATH
+PGDATA=`cd $PGDATA && pwd`
+
 
 ##########################################################################
 #