If you want to ensure you are restarting your correct Postgres version (e.g. version 15) AND your Postgres is not installed as a Service, then you can use the pg_ctl command and specify your data directory. Where is your data directory? Do the following:
% psql
viglione=# SELECT name, setting, context FROM pg_settings WHERE category = 'File Locations';
name | setting | context
-------------------+-------------------------------------------------+------------
config_file | /opt/homebrew/var/postgresql@15/postgresql.conf | postmaster
data_directory | /opt/homebrew/var/postgresql@15 | postmaster
external_pid_file | | postmaster
hba_file | /opt/homebrew/var/postgresql@15/pg_hba.conf | postmaster
ident_file | /opt/homebrew/var/postgresql@15/pg_ident.conf | postmaster
(5 rows)
I like to project the context column to reaffirm the settings that do require restart. If the value is postmaster, then you must use pg_ctl restart and not pg_ctl reload. Note the data_directory in row two. We can then specify that as an option to pg_ctl restart. First exit psql and then run the command at the OS level (note since in my case I am using homebrew package manager, i wouldn't use this option):
viglione# \q
% pg_ctl restart -D /opt/homebrew/var/postgresql@15
Given I am using homebrew, which is a system service, I would use this option:
% brew services restart postgresql@15