|
27 | 27 | #
|
28 | 28 | #
|
29 | 29 | # IDENTIFICATION
|
30 |
| -# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.71 1999/12/18 02:48:53 momjian Exp $ |
| 30 | +# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.72 1999/12/18 02:56:01 momjian Exp $ |
31 | 31 | #
|
32 | 32 | #-------------------------------------------------------------------------
|
33 | 33 |
|
|
65 | 65 | PGPATH=`echo$0| sed's,/[^/]*$,,'`# (dirname command is not portable)
|
66 | 66 | else
|
67 | 67 | # look for it in PATH ('which' command is not portable)
|
68 |
| -fordirin`echo"$PATH"| sed's/:/ /g'`;do |
| 68 | +fordirin`echo"$PATH"| sed's/:/ /g'` |
| 69 | +do |
69 | 70 | # empty entry in path means current dir
|
70 | 71 | [-z"$dir" ]&& dir='.'
|
71 | 72 | if [-f"$dir/$CMDNAME" ]
|
72 |
| -then |
| 73 | +then |
73 | 74 | PGPATH="$dir"
|
74 | 75 | break
|
75 | 76 | fi
|
76 | 77 | done
|
77 | 78 | fi
|
78 | 79 |
|
79 | 80 | # Check if needed programs actually exist in path
|
80 |
| -forprogin postgres pg_version;do |
| 81 | +forprogin postgres pg_version |
| 82 | +do |
81 | 83 | if [!-x"$PGPATH/$prog" ]
|
82 |
| -then |
| 84 | +then |
83 | 85 | echo"The program$prog needed by$CMDNAME could not be found. It was"
|
84 | 86 | echo"expected at:"
|
85 | 87 | echo"$PGPATH/$prog"
|
@@ -111,11 +113,6 @@ template_only=0
|
111 | 113 | # user.
|
112 | 114 | POSTGRES_SUPERUSERNAME="$EffectiveUser"
|
113 | 115 |
|
114 |
| -# Note: The sysid can be freely selected. This will probably confuse matters, |
115 |
| -# but if your Unix user postgres is uid 48327 you might chose to start |
116 |
| -# at 0 (or 1) in the database. |
117 |
| -POSTGRES_SUPERUSERID="$EUID" |
118 |
| - |
119 | 116 | Password='_null_'
|
120 | 117 |
|
121 | 118 | while ["$#"-gt 0 ]
|
|
225 | 222 | if [-n"$MULTIBYTE" ]
|
226 | 223 | then
|
227 | 224 | echo" -e ENCODING, --pgencoding=ENCODING"
|
228 |
| -fi |
| 225 | +fi |
229 | 226 | echo" -?, --help"
|
230 | 227 | echo""
|
231 | 228 | exit 0
|
|
237 | 234 |
|
238 | 235 | if ["$MULTIBYTE" ]
|
239 | 236 | then
|
240 |
| -MULTIBYTEID=`$PGPATH/pg_encoding$MULTIBYTE` |
| 237 | +MULTIBYTEID=`$PGPATH/pg_encoding$MULTIBYTE` |
241 | 238 | if ["$?"-ne 0 ]
|
242 |
| -then |
| 239 | +then |
243 | 240 | echo"The program pg_encoding failed. Perhaps you did not configure"
|
244 | 241 | echo"PostgreSQL for multibyte support or the program was not success-"
|
245 | 242 | echo"fully installed."
|
@@ -298,9 +295,10 @@ echo
|
298 | 295 |
|
299 | 296 | if [-z"$PGLIB" ]
|
300 | 297 | then
|
301 |
| -fordirin"$PGPATH/../lib""$PGPATH/../lib/pgsql";do |
| 298 | +fordirin"$PGPATH/../lib""$PGPATH/../lib/pgsql" |
| 299 | +do |
302 | 300 | if [-f"$dir/global1.bki.source" ]
|
303 |
| -then |
| 301 | +then |
304 | 302 | PGLIB="$dir"
|
305 | 303 | break
|
306 | 304 | fi
|
@@ -355,7 +353,7 @@ umask 077
|
355 | 353 | if [-f"$PGDATA"/PG_VERSION ]
|
356 | 354 | then
|
357 | 355 | if ["$template_only"-eq 0 ]
|
358 |
| -then |
| 356 | +then |
359 | 357 | echo"$CMDNAME: The file$PGDATA/PG_VERSION already exists."
|
360 | 358 | echo"This probably means initdb has already been run and the"
|
361 | 359 | echo"database system already exists."
|
|
381 | 379 | mkdir"$PGDATA"/base|| exit_nicely
|
382 | 380 | fi
|
383 | 381 | if [!-d"$PGDATA"/pg_xlog ]
|
384 |
| -then |
| 382 | +then |
385 | 383 | echo"Creating database XLOG directory$PGDATA/pg_xlog"
|
386 | 384 | mkdir"$PGDATA"/pg_xlog|| exit_nicely
|
387 | 385 | fi
|
|
448 | 446 | # Gotta remove that temp file before exiting on error.
|
449 | 447 | retval="$?"
|
450 | 448 | if ["$noclean"-eq 0 ]
|
451 |
| -then |
| 449 | +then |
452 | 450 | rm -f"$TEMPFILE"|| exit_nicely
|
453 | 451 | fi
|
454 | 452 | ["$retval"-ne 0 ]&& exit_nicely
|
|