Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pg_ctl: no database directory specified and environment variable PGDATA unset

Tags:

sql

postgresql

when I run the command: pg restart on windows 10 i take the below error: pg_ctl: no database directory specified and environment variable PGDATA unset

like image 857
chrisgk Avatar asked Jun 26 '17 14:06

chrisgk


1 Answers

You need to specify where the database directory is installed to.

eg

pg_ctl restart -D [insert directory location here]

Failing that you will need to set the environment variable PGDATA. Something like

 set $PGDATA = [directory location here]
like image 154
VynlJunkie Avatar answered Oct 17 '22 21:10

VynlJunkie