This post talks about using pg_ctl to register PostgreSQL as a service on Windows. In my experience many big PostgreSQL instances are on Linux / UNIX these days. However, recently we have seen quite a number of Windows systems running PostgreSQL for a bigger production system. There are still rarely really large databases (XX TB) on Windows. However, Windows might very well catch up a bit in the future.
On Linux there are ready to use packages, which make it very easy to deploy more than just one instance on a single node.
On Windows the story is a bit different. I have seen many people, who had a hard time registering services. To all of those out there suffering in silence there is a hopefully vital piece of information...
If you happen to run Windows, pg_ctl provides a nice way to register a service:
1 2 |
pg_ctl register [-N servicename] [-U username] [-P password] [-D datadir] [-S a[uto] | d[emand] ] [-w] [-t seconds] [-s] [-o options] |
Using “pg_ctl register” is a lot easier than to fiddle around with Windows command line interfaces in general. It allows people to quickly register services in a nice and clean way.
Read on to find out more about PostgreSQL and Windows on Pavlo's blog detailling install and setup for PostgreSQL on WSL2 for Windows.
In order to receive regular updates on important changes in PostgreSQL, subscribe to our newsletter, or follow us on Facebook or LinkedIn.
You need to load content from reCAPTCHA to submit the form. Please note that doing so will share data with third-party providers.
More InformationYou are currently viewing a placeholder content from Facebook. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.
More InformationYou are currently viewing a placeholder content from X. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.
More Information
Hi Hans,
Can pg_ctl be used to register pgbouncer?