pg_ctl cleanup - Mailing list pgsql-patches

From Neil Conway
Subject pg_ctl cleanup
Date
Msg-id 1097730543.4682.15.camel@localhost.localdomain
Whole thread Raw
Responses Re: pg_ctl cleanup
List 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

pgsql-patches by date:

Previous
From: Devrim GUNDUZ
Date:
Subject: (Turkish)New translation: pg_config
Next
From: Bruce Momjian
Date:
Subject: Re: cast pid_t to int when using *printf