I've made some changes to pg_hba.conf and I want them to take affect. I've found several places where people say that I can tell PostgreSQL to reload, but there are several different techniques listed, and none of them work for me yet.

The most authoritative reference I've found is for the pg_ctl command, but I'm not sure where my PGDATA folder is. I'll keep looking.

I'm running PostgreSQL 8.3 on Ubuntu 8.10.

11 Answers 11


You can check where your PGDATA is by connecting to pg, and issuing command:

show data_directory;

On ubuntu, it's usually /var/lib/postgresql/8.3/main/.

Also, you can: /etc/init.d/postgresql-8.3 reload


Though the original person asking the question implied he's running Ubuntu 8.10 many people, using later versions of Ubuntu might stumble here as well. And this might in fact work with 8.10 too. I dunno, I don't have any 8.10 installations to try it with..

Ok, lets cut to the point. So the cool "new" way of controlling services is to use the service command. So you can reload configs with the following command:

service postgresql-8.3 reload

naturally you need to have the proper rights so it is most likely required to prepend the command with something like sudo or su -c root like this:

sudo service postgresql-8.3 reload
su -c root 'service postgresql-8.3 reload'

P.S. It is suggested in the Ubuntu documentation that something relating to this new method had been done way back there with the release of 6.10, however if I've understood it correctly it had not been taken into more general use until 9.10.

  • I have upgraded in the last two years, so I'll try this out. Thanks for keeping me cool.
    – Don Kirkby
    Commented Sep 26, 2011 at 17:56
  • It's generally better to use su - in place of just su
    – x-yuri
    Commented Oct 23, 2018 at 11:34

Option 1: From the command-line shell

su - postgres
/usr/bin/pg_ctl reload

Option 2: Using SQL

SELECT pg_reload_conf();

Using either option will not interrupt any active queries or connections to the database, thus applying these changes seemlessly.

  • Best answer because of the option to do it in SQL without the need for command line access.
    – not2savvy
    Commented Oct 27, 2023 at 4:56

This will do the trick:

kill -HUP $(head -1 $PGDATA/postmaster.pid)

If you don't want to restart the server and just send a signal to postgreSQL, just type command:
pg_ctl reload


I finally found a technique that works for me from this article. The command is:

sudo invoke-rc.d postgresql-8.3 reload

I'd still appreciate feedback on what the recommended technique is.

  • 1
    If you are using packaged PostgreSQL, using the package script - like this example has for Ubuntu - would be the recommended technique. If you've built from source, use pg_ctl. Commented Sep 2, 2009 at 8:03

The following should do it for you:

sudo /etc/init.d/postgresql-8.3 reload

On a modern linux disto with systemd, I had to use systemctl to restart postgres. Here's what worked on CentOS7:

First find the precise name of the current Postgres service:

systemctl | grep postgres

Results are:

loaded active     running      PostgreSQL 10 database server

Then use that name to restart Postgres:

sudo systemctl restart postgresql-10.service

On Debian/Ubuntu/etc. versions using systemd:

systemctl reload postgresql


sudo systemctl reload postgresql

On other systems, this should do:

su -c "pg_ctl reload" - postgres

I just used:

/etc/init.d/postgresql reload

ls /etc/init.d/ Look whats there see postgresql?

sudo /etc/init.d/postgresql reload


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .