pg_ctl cleanup

From: Neil Conway <neilc(at)samurai(dot)com>
To: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: pg_ctl cleanup
Date: 2004-10-14 05:09:03
Message-ID: 1097730543.4682.15.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

This patch makes a couple small changes to pg_ctl:

- refactor a bunch of code to call a separate function print_msg() which
checks whether "silent mode" is enabled before printing an error
message. I could have made print_msg() take a varargs list, but I didn't
bother ("worse is better"). Also, we do fflush() whether it is needed or
not, on the grounds performance here is irrelevant.

- rename "silence_mode" to "silent_mode", which IMHO makes more sense

- make the error messages we emit in "waiting" mode more consistent (I
believe this is a recent regression introduced by Peter's error message
commit). The patch changes the output to:

% pg_ctl -l /tmp/foo -w start
waiting for postmaster to start.... done
postmaster started
% pg_ctl -l /tmp/foo -w stop
waiting for postmaster to shut down.... done
postmaster stopped

Rather than:

% pg_ctl -l /tmp/foo -w start
waiting for postmaster to start....done
postmaster started
% pg_ctl -l /tmp/foo -w stop
waiting for postmaster to shut down... .done
postmaster stopped

Barring any objections, I intend to apply to HEAD tomorrow.

-Neil

Attachment Content-Type Size
pg_ctl_error_msg-1.patch text/x-patch 6.1 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2004-10-14 19:09:42 plperl Safe restrictions
Previous Message Serguei Mokhov 2004-10-13 23:35:43 Translation updates for 8.0: initdb-ru, pg_config-ru