[patch] 7.4 initdb - drop trailing slash from $PGDATA - Mailing list pgsql-patches

From jari.aalto@poboxes.com (Jari Aalto)
Subject [patch] 7.4 initdb - drop trailing slash from $PGDATA
Date
Msg-id d69i4y7m.fsf@blue.sea.net
Whole thread Raw
Responses Re: [patch] 7.4 initdb - drop trailing slash from $PGDATA  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-patches

I made a mistake while running 7.4 under W2k/Cygwin, so perhaps
the patch would give user a little more comfort.

root@w2kpicasso:~/work/tpu/course/1132/sql/postgres# LC_ALL=C initdb /usr/share/postgresql/data/
The files belonging to this database system will be owned by user "root".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /usr/share/postgresql/data/... ok
creating directory /usr/share/postgresql/data//base... ok
creating directory /usr/share/postgresql/data//global... ok
creating directory /usr/share/postgresql/data//pg_xlog... ok
creating directory /usr/share/postgresql/data//pg_clog... ok
selecting default max_connections... Caught signal.
Caught signal.




--- initdb.orig    2004-01-17 13:14:36.000000000 +0200
+++ initdb    2004-01-17 13:18:08.000000000 +0200
@@ -333,6 +333,15 @@
     shift
 done

+
+
+if [ ! -z "$PGDATA" ]; then
+    #  Remove trailing slash
+    PGDATA=`echo "$PGDATA" | sed -e "s/\/$//"`
+fi
+
+
+
 if [ "$usage" ]; then
     echo "$CMDNAME initializes a PostgreSQL database cluster."
     echo


pgsql-patches by date:

Previous
From: jari.aalto@poboxes.com (Jari Aalto)
Date:
Subject: [patch] INSTALL doc note (was Re: [BUGS] BUG #1051: Cannot remove groups)
Next
From: jari.aalto@poboxes.com (Jari Aalto)
Date:
Subject: [patch] Postgres 7.4 - doc INSTALL/Cygwin