I tried the following and it failed
bash-3.2$ pg_ctl restart
pg_ctl: no database directory specified and environment variable PGDATA unset
<
One liner (with default postgresSql 9.6 install)
sudo su postgres -c "/Library/PostgreSQL/9.6/bin/pg_ctl restart -D /Library/PostgreSQL/9.6/data"
Full version
Get the pgdata folder (gave me /Library/PostgreSQL/9.6/data) (thanks @a_horse_with_no_name)
select name, setting from pg_settings where name = 'data_directory';
For me it returns '/Library/PostgreSQL/9.6/data'
Then
sudo su - postgres
./bin/pg_ctl restart -D /Library/PostgreSQL/9.6/data
Note: postgres' user home dir should be "/Library/PostgreSQL/9.6"