Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I forgot how I last time started postgres (it was months ago) and I don't remember where the data directory is located at. The postgres command seems to require to location. I'm on MacOsX if that helps.

On Windows Server 2012, the command pg_config did not reveal the data directory for some crazy reason. But I found it by looking at the file C:\Program Files\PostgreSQL\9.4\pg_env.bat, which contained this line: