How to restart PostgreSQL server under CentOS 7

I found out that you need to specify the exact name for the PostgreSQL service, which you can find under the list of services, using systemctl (also see this post):

systemctl list-units|grep postgresql
postgresql-10.service                                                                     loaded active running   PostgreSQL 10 database server

Then you can use service:

service postgresql-10.service reload

or

service postgresql-10.service restart

Alternatively, you can use the systemctl command:

/bin/systemctl reload postgresql-10.service

or

/bin/systemctl restart postgresql-10.service

If you have sudogoer as a role in postgresql, you can alternatively use:

sudo systemctl restart postgresql