1
1
#! /bin/sh
2
- # $Header: /cvsroot/pgsql/src/test/regress/Attic/pg_regress.sh,v 1.3 2000/10/0206:03:25 tgl Exp $
2
+ # $Header: /cvsroot/pgsql/src/test/regress/Attic/pg_regress.sh,v 1.4 2000/10/0211:47:30 petere Exp $
3
3
4
4
me=` basename$0 `
5
5
: ${TMPDIR=/ tmp}
@@ -81,6 +81,9 @@ unset top_builddir
81
81
unset temp_install
82
82
unset multibyte
83
83
84
+ export PGHOST
85
+ export PGPORT
86
+
84
87
dbname=regression
85
88
hostname=` hostname` || hostname=localhost
86
89
@@ -154,8 +157,6 @@ case $host_platform in
154
157
unix_sockets=yes;;
155
158
esac
156
159
157
- [" $unix_sockets " = no ]&& psql_options=" $psql_options -h$PGHOST "
158
-
159
160
160
161
# ----------
161
162
# Set up diff to ignore horizontal white space differences.
@@ -257,7 +258,11 @@ then
257
258
libdir=$temp_install /$libdir
258
259
datadir=$temp_install /$datadir
259
260
PGDATA=$temp_install /data
260
- PGHOST=$hostname
261
+ if [" $unix_sockets " = no ]; then
262
+ PGHOST=$hostname
263
+ else
264
+ unset PGHOST
265
+ fi
261
266
PGPORT=65432
262
267
263
268
# ----------
314
319
message" starting postmaster"
315
320
[" $debug " = yes ]&& postmaster_options=" $postmaster_options -d 5"
316
321
[" $unix_sockets " = no ]&& postmaster_options=" $postmaster_options -i"
317
- " $bindir /postmaster" -D" $PGDATA " -p " $PGPORT " - F$postmaster_options > " $LOGDIR /postmaster.log" 2>&1 &
322
+ " $bindir /postmaster" -D" $PGDATA " -F$postmaster_options > " $LOGDIR /postmaster.log" 2>&1 &
318
323
postmaster_pid=$!
319
324
320
325
if kill -0$postmaster_pid > /dev/null2>&1
@@ -333,13 +338,22 @@ then
333
338
334
339
else # not temp-install
335
340
341
+ # If Unix sockets are not available, use the local host by default.
342
+ [" $unix_sockets " = no ]&& ${PGHOST=$hostname }
343
+
344
+ if [-n " $PGPORT " ]; then
345
+ port_info=" port$PGPORT "
346
+ else
347
+ port_info=" default port"
348
+ fi
349
+
336
350
if [-n " $PGHOST " ]; then
337
- echo " (using postmaster on$PGHOST at port $PGPORT )"
351
+ echo " (using postmaster on$PGHOST , $port_info )"
338
352
else
339
- echo " (using postmaster on Unix socket with port $PGPORT )"
353
+ echo " (using postmaster on Unix socket, $port_info )"
340
354
fi
341
355
message" dropping database\" $dbname \" "
342
- " $bindir /dropdb" -p " $PGPORT " $psql_options " $dbname " > /dev/null2>&1
356
+ " $bindir /dropdb" $psql_options " $dbname " > /dev/null2>&1
343
357
# errors can be ignored
344
358
fi
345
359
348
362
# Set up SQL shell for the test.
349
363
# ----------
350
364
351
- PSQL=" $bindir /psql -a -q -X$psql_options -p $PGPORT "
365
+ PSQL=" $bindir /psql -a -q -X$psql_options "
352
366
353
367
354
368
# ----------
377
391
# ----------
378
392
379
393
message" creating database\" $dbname \" "
380
- " $bindir /createdb" -p " $PGPORT " $encoding_opt $psql_options " $dbname "
394
+ " $bindir /createdb" $encoding_opt $psql_options " $dbname "
381
395
if [$? -ne 0 ]; then
382
396
echo " $me : createdb failed"
383
397
(exit 2); exit
@@ -392,7 +406,7 @@ case $host_platform in
392
406
* -* -qnx* ): ;;
393
407
* )
394
408
message" installing PL/pgSQL"
395
- " $bindir /createlang" -p " $PGPORT " - L" $libdir " $psql_options plpgsql$dbname
409
+ " $bindir /createlang" -L" $libdir " $psql_options plpgsql$dbname
396
410
if [$? -ne 0 ]&& [$? -ne 2 ]; then
397
411
echo " $me : createlang failed"
398
412
(exit 2); exit