Re: Re: Why not to use 'pg_ctl start -D ../data' to register posgtresql windows service - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Re: Why not to use 'pg_ctl start -D ../data' to register posgtresql windows service
Date
Msg-id CAB7nPqQR9HcigNfVjje_tMoPDSem6-sQ33GuELeWBHKiT6zLiQ@mail.gmail.com
Whole thread Raw
In response to Re: Why not to use 'pg_ctl start -D ../data' to register posgtresql windows service  (YuanyuanLiu <liuyuanyuangogo@gmail.com>)
Responses Re: Re: Why not to use 'pg_ctl start -D ../data' to register posgtresql windows service  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Mon, Nov 2, 2015 at 4:27 PM, YuanyuanLiu <liuyuanyuangogo@gmail.com> wrote:
> When we registered postgresql windows service named "postgres-9.4",
> we can start the postgresql server by manually  starting the windows service
> , runing command "net stop postgres-9.4" (need user with administrator
> privilege), or runing command "pg_ctl start -D ../path/to/data".

Yep. Those are two examples to stop a registered service. You could
use "sc stop postgres-9.4" as well. Note also that when a service
registered is stopped with pg_ctl, SCM will recognize that the service
has been stopped.

> The started postgresql service must be stopped in the same session.
> Is this right ?

When a service has been registered to the Windows SCM, a service
started with sc or net will persist even if the prompt that started it
is closed. Now, if you start a service with "pg_ctl start -d data",
even if the service is registered it will *not* by recognized by SCM
as started. And this one will stop immediately once the prompt that
started it is closed.
-- 
Michael



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Personal note: changing employers
Next
From: Michael Paquier
Date:
Subject: Re: Re: Why not to use 'pg_ctl start -D ../data' to register posgtresql windows service