From: Peter Eisentraut Date: Fri, 13 Jan 2017 17:00:00 +0000 (-0500) Subject: Updates to reflect that pg_ctl stop -m fast is the default X-Git-Tag: REL_10_BETA1~1118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e574f15d6295b12c03ef8810c00976b65933711a;p=postgresql Updates to reflect that pg_ctl stop -m fast is the default Various example and test code used -m fast explicitly, but since it's the default, this can be omitted now or should be replaced by a better example. pg_upgrade is not touched, so it can continue to operate with older installations. --- diff --git a/contrib/start-scripts/freebsd b/contrib/start-scripts/freebsd index 758574b427..87d9b9b357 100644 --- a/contrib/start-scripts/freebsd +++ b/contrib/start-scripts/freebsd @@ -48,10 +48,10 @@ case $1 in echo -n ' postgresql' ;; stop) - su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast" + su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s" ;; restart) - su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast -w" + su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -w" su -l $PGUSER -c "$DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1 ;; status) diff --git a/contrib/start-scripts/linux b/contrib/start-scripts/linux index c88433a0e2..d7499c9d1e 100644 --- a/contrib/start-scripts/linux +++ b/contrib/start-scripts/linux @@ -97,12 +97,12 @@ case $1 in ;; stop) echo -n "Stopping PostgreSQL: " - su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast" + su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s" echo "ok" ;; restart) echo -n "Restarting PostgreSQL: " - su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast -w" + su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -w" test -e "$PG_OOM_ADJUST_FILE" && echo "$PG_MASTER_OOM_SCORE_ADJ" > "$PG_OOM_ADJUST_FILE" su - $PGUSER -c "$DAEMON_ENV $DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1 echo "ok" diff --git a/contrib/start-scripts/osx/PostgreSQL b/contrib/start-scripts/osx/PostgreSQL index d38504dcc2..48c098c8f1 100755 --- a/contrib/start-scripts/osx/PostgreSQL +++ b/contrib/start-scripts/osx/PostgreSQL @@ -90,14 +90,14 @@ StartService () { StopService () { ConsoleMessage "Stopping PostgreSQL database server" - sudo -u $PGUSER sh -c "$PGCTL stop -D '${PGDATA}' -s -m fast" + sudo -u $PGUSER sh -c "$PGCTL stop -D '${PGDATA}' -s" } RestartService () { if [ "${POSTGRESQL:=-NO-}" = "-YES-" ]; then ConsoleMessage "Restarting PostgreSQL database server" # should match StopService: - sudo -u $PGUSER sh -c "$PGCTL stop -D '${PGDATA}' -s -m fast" + sudo -u $PGUSER sh -c "$PGCTL stop -D '${PGDATA}' -s" # should match StartService: if [ "${ROTATELOGS}" = "1" ]; then sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" 2>&1 | ${LOGUTIL} "${PGLOG}" ${ROTATESEC} & diff --git a/doc/src/sgml/ref/pg_ctl-ref.sgml b/doc/src/sgml/ref/pg_ctl-ref.sgml index 5fb6898699..3f168005ec 100644 --- a/doc/src/sgml/ref/pg_ctl-ref.sgml +++ b/doc/src/sgml/ref/pg_ctl-ref.sgml @@ -615,7 +615,7 @@ PostgreSQL documentation The option allows control over how the server shuts down: -$ pg_ctl stop -m fast +$ pg_ctl stop -m smart diff --git a/src/bin/pg_ctl/t/001_start_stop.pl b/src/bin/pg_ctl/t/001_start_stop.pl index cbe99d79ad..b328f22487 100644 --- a/src/bin/pg_ctl/t/001_start_stop.pl +++ b/src/bin/pg_ctl/t/001_start_stop.pl @@ -42,14 +42,14 @@ command_ok([ 'pg_ctl', 'start', '-D', "$tempdir/data", '-w' ], sleep 3 if ($windows_os); command_fails([ 'pg_ctl', 'start', '-D', "$tempdir/data", '-w' ], 'second pg_ctl start -w fails'); -command_ok([ 'pg_ctl', 'stop', '-D', "$tempdir/data", '-w', '-m', 'fast' ], +command_ok([ 'pg_ctl', 'stop', '-D', "$tempdir/data", '-w' ], 'pg_ctl stop -w'); -command_fails([ 'pg_ctl', 'stop', '-D', "$tempdir/data", '-w', '-m', 'fast' ], +command_fails([ 'pg_ctl', 'stop', '-D', "$tempdir/data", '-w' ], 'second pg_ctl stop fails'); -command_ok([ 'pg_ctl', 'restart', '-D', "$tempdir/data", '-w', '-m', 'fast' ], +command_ok([ 'pg_ctl', 'restart', '-D', "$tempdir/data", '-w' ], 'pg_ctl restart with server not running'); -command_ok([ 'pg_ctl', 'restart', '-D', "$tempdir/data", '-w', '-m', 'fast' ], +command_ok([ 'pg_ctl', 'restart', '-D', "$tempdir/data", '-w' ], 'pg_ctl restart with server running'); -system_or_bail 'pg_ctl', 'stop', '-D', "$tempdir/data", '-m', 'fast'; +system_or_bail 'pg_ctl', 'stop', '-D', "$tempdir/data"; diff --git a/src/bin/pg_ctl/t/002_status.pl b/src/bin/pg_ctl/t/002_status.pl index 98e171e394..606d10560f 100644 --- a/src/bin/pg_ctl/t/002_status.pl +++ b/src/bin/pg_ctl/t/002_status.pl @@ -22,4 +22,4 @@ system_or_bail 'pg_ctl', '-l', "$tempdir/logfile", '-D', command_exit_is([ 'pg_ctl', 'status', '-D', $node->data_dir ], 0, 'pg_ctl status with server running'); -system_or_bail 'pg_ctl', 'stop', '-D', $node->data_dir, '-m', 'fast'; +system_or_bail 'pg_ctl', 'stop', '-D', $node->data_dir; diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index baebcc8c32..d4d00d9c66 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -265,7 +265,7 @@ stop_postmaster(void) fflush(stderr); snprintf(buf, sizeof(buf), - "\"%s%spg_ctl\" stop -D \"%s/data\" -s -m fast", + "\"%s%spg_ctl\" stop -D \"%s/data\" -s", bindir ? bindir : "", bindir ? "/" : "", temp_instance); diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index bcf22677ac..f575e40052 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -465,7 +465,7 @@ sub upgradecheck @args = ('pg_dumpall', '-f', "$tmp_root/dump1.sql"); system(@args) == 0 or exit 1; print "\nStopping old cluster\n\n"; - system("pg_ctl -m fast stop") == 0 or exit 1; + system("pg_ctl stop") == 0 or exit 1; $ENV{PGDATA} = "$data"; print "\nSetting up new cluster\n\n"; standard_initdb() or exit 1; @@ -483,7 +483,7 @@ sub upgradecheck @args = ('pg_dumpall', '-f', "$tmp_root/dump2.sql"); system(@args) == 0 or exit 1; print "\nStopping new cluster\n\n"; - system("pg_ctl -m fast stop") == 0 or exit 1; + system("pg_ctl stop") == 0 or exit 1; print "\nDeleting old cluster\n\n"; system(".\\delete_old_cluster.bat") == 0 or exit 1; print "\nComparing old and new cluster dumps\n\n";