Re: pg_ctl do_restart

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_ctl do_restart
Date: 2008-04-23 15:04:51
Message-ID: 10870.1208963091@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> Can anybody recall a reason for why the do_restart() function in pg_ctl
> copies a lot of code almost right off from do_stop(), instead of just
> having that code exactly the same as do_stop() and factored out? (Like
> it does for do_start() already)

> I see the point in dealing with the very first branch differently, but
> for example why do we do the postmaster_is_alive() patch only in
> restart and not in stop?

+1 for refactoring, but be careful you don't break the corner cases.
In particular, what should happen if the postmaster wasn't running
(is restart the same as start, or should it throw an error)? And
don't bollix things if the postmaster is running and the "stop"
step fails.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-04-23 16:04:32 Re: Index AM change proposals, redux
Previous Message Simon Riggs 2008-04-23 14:18:41 Re: Concurrent psql API