Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to restart postgresql service in windows 10 when updating pg_hba.config

Tags:

postgresql

please somebody tell me how to restart PostgreSQL service in windows 10 when updating pg_hba.config, and the steps to allow remote connections to a psql database please

like image 370
coder Avatar asked Nov 07 '16 05:11

coder


Video Answer


1 Answers

You don't need to restart the service to activate changes done to pg_hba.conf.

All you need to do is to reload the configuration.

Reload using a SQL statement

You can re-load all configuration files using a SQL statement, e.g. from within psql - but any SQL client will do:

select pg_reload_conf();

You must log-in to Postgres as a database super user (typically postgres).

Reload using pg_ctl

pg_ctl can be used to signal a reload to the server

pg_ctl reload -D \path\to\datadirectory

The data directory is the one you specified during installation. If you don't know where the data directory is, use a SQL client and run show data_directory; to find out.

Restart the Windows service

If you do want to restart the service completely then do this as you would with any other Windows service through the control panel. Alternatively you can do that on the command line

like image 186
a_horse_with_no_name Avatar answered Sep 30 '22 17:09

a_horse_with_no_name