diff --git a/pgtest.sh b/pgtest.sh
index 546d2db4eb5c882256d0b966b86509dcb83e6136..be58830da8698a5cbff396fb327c79e50e8b583a 100755 (executable)
--- a/pgtest.sh
+++ b/pgtest.sh
stop)
if test $# -ne 1; then
echo "Too many arguments!" >&2
- echo "Usage: $0 setup" >&2
+ echo "Usage: $0 stop" >&2
exit 1
fi
$BIN_DIR/pg_ctl -D $TARGET/var/lib/postgresql/main stop
$BIN_DIR/postgres -D $TARGET/var/lib/postgresql/main "$@"
fi
;;
+ restart)
+ $0 stop && $0 start -B
+ ;;
*)
echo "Usage: $0 setup|client|stop|start" >&2
+ echo ""
+ echo " - setup"
+ echo " Set up a new PostgreSQL server listening on port 2345."
+ echo " - client [<psql args>]"
+ echo " Start a PostgreSQL interactive terminal connected to the"
+ echo " PostgreSQL server on port 2345."
+ echo " - start [-B [<postgres args>]]"
+ echo " Start the PostgreSQL server."
+ echo " - stop"
+ echo " Stop the PostgreSQL server."
+ echo " - restart"
+ echo " Restart a background PostgreSQL server process."
+ echo ""
+ echo "Environment variables:"
+ echo " - TARGET"
+ echo " Target directory of the PostgreSQL test setup."
+ if test "$1" = "help"; then
+ exit 0
+ fi
exit 1
;;
esac