mirror of
https://github.com/postgres/postgres.git
synced 2025-04-20 00:42:27 +03:00
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.
This commit is contained in:
parent
5ad966ab1c
commit
e574f15d62
@ -48,10 +48,10 @@ case $1 in
|
|||||||
echo -n ' postgresql'
|
echo -n ' postgresql'
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast"
|
su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s"
|
||||||
;;
|
;;
|
||||||
restart)
|
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
|
su -l $PGUSER -c "$DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
|
@ -97,12 +97,12 @@ case $1 in
|
|||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Stopping PostgreSQL: "
|
echo -n "Stopping PostgreSQL: "
|
||||||
su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast"
|
su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s"
|
||||||
echo "ok"
|
echo "ok"
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
echo -n "Restarting PostgreSQL: "
|
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"
|
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
|
su - $PGUSER -c "$DAEMON_ENV $DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1
|
||||||
echo "ok"
|
echo "ok"
|
||||||
|
@ -90,14 +90,14 @@ StartService () {
|
|||||||
|
|
||||||
StopService () {
|
StopService () {
|
||||||
ConsoleMessage "Stopping PostgreSQL database server"
|
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 () {
|
RestartService () {
|
||||||
if [ "${POSTGRESQL:=-NO-}" = "-YES-" ]; then
|
if [ "${POSTGRESQL:=-NO-}" = "-YES-" ]; then
|
||||||
ConsoleMessage "Restarting PostgreSQL database server"
|
ConsoleMessage "Restarting PostgreSQL database server"
|
||||||
# should match StopService:
|
# 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:
|
# should match StartService:
|
||||||
if [ "${ROTATELOGS}" = "1" ]; then
|
if [ "${ROTATELOGS}" = "1" ]; then
|
||||||
sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" 2>&1 | ${LOGUTIL} "${PGLOG}" ${ROTATESEC} &
|
sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" 2>&1 | ${LOGUTIL} "${PGLOG}" ${ROTATESEC} &
|
||||||
|
@ -615,7 +615,7 @@ PostgreSQL documentation
|
|||||||
The <option>-m</option> option allows control over
|
The <option>-m</option> option allows control over
|
||||||
<emphasis>how</emphasis> the server shuts down:
|
<emphasis>how</emphasis> the server shuts down:
|
||||||
<screen>
|
<screen>
|
||||||
<prompt>$</prompt> <userinput>pg_ctl stop -m fast</userinput>
|
<prompt>$</prompt> <userinput>pg_ctl stop -m smart</userinput>
|
||||||
</screen></para>
|
</screen></para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
|
@ -42,14 +42,14 @@ command_ok([ 'pg_ctl', 'start', '-D', "$tempdir/data", '-w' ],
|
|||||||
sleep 3 if ($windows_os);
|
sleep 3 if ($windows_os);
|
||||||
command_fails([ 'pg_ctl', 'start', '-D', "$tempdir/data", '-w' ],
|
command_fails([ 'pg_ctl', 'start', '-D', "$tempdir/data", '-w' ],
|
||||||
'second pg_ctl start -w fails');
|
'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');
|
'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');
|
'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');
|
'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');
|
'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";
|
||||||
|
@ -22,4 +22,4 @@ system_or_bail 'pg_ctl', '-l', "$tempdir/logfile", '-D',
|
|||||||
command_exit_is([ 'pg_ctl', 'status', '-D', $node->data_dir ],
|
command_exit_is([ 'pg_ctl', 'status', '-D', $node->data_dir ],
|
||||||
0, 'pg_ctl status with server running');
|
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;
|
||||||
|
@ -265,7 +265,7 @@ stop_postmaster(void)
|
|||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf),
|
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 ? bindir : "",
|
||||||
bindir ? "/" : "",
|
bindir ? "/" : "",
|
||||||
temp_instance);
|
temp_instance);
|
||||||
|
@ -465,7 +465,7 @@ sub upgradecheck
|
|||||||
@args = ('pg_dumpall', '-f', "$tmp_root/dump1.sql");
|
@args = ('pg_dumpall', '-f', "$tmp_root/dump1.sql");
|
||||||
system(@args) == 0 or exit 1;
|
system(@args) == 0 or exit 1;
|
||||||
print "\nStopping old cluster\n\n";
|
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";
|
$ENV{PGDATA} = "$data";
|
||||||
print "\nSetting up new cluster\n\n";
|
print "\nSetting up new cluster\n\n";
|
||||||
standard_initdb() or exit 1;
|
standard_initdb() or exit 1;
|
||||||
@ -483,7 +483,7 @@ sub upgradecheck
|
|||||||
@args = ('pg_dumpall', '-f', "$tmp_root/dump2.sql");
|
@args = ('pg_dumpall', '-f', "$tmp_root/dump2.sql");
|
||||||
system(@args) == 0 or exit 1;
|
system(@args) == 0 or exit 1;
|
||||||
print "\nStopping new cluster\n\n";
|
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";
|
print "\nDeleting old cluster\n\n";
|
||||||
system(".\\delete_old_cluster.bat") == 0 or exit 1;
|
system(".\\delete_old_cluster.bat") == 0 or exit 1;
|
||||||
print "\nComparing old and new cluster dumps\n\n";
|
print "\nComparing old and new cluster dumps\n\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user