Thread: pg_ctl cleanup

pg_ctl cleanup

From
Neil Conway
Date:
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

Re: pg_ctl cleanup

From
Neil Conway
Date:
On Thu, 2004-10-14 at 15:09, Neil Conway wrote:
> This patch makes a couple small changes to pg_ctl [...]

A slightly revised version of the patch was applied to HEAD; the revised
patch is attached.

-Neil


Attachment