8

Is it possible to determine the cluster directory being used by a Postgres server, from the server itself -- i.e. the service, (under Windows) was started by something like:

C:\foo\postgres.exe -D "D:\emr\data"

Is there a SELECT query or function one can make to the running server to retrieve the value D:\emr\data?

2 Answers 2

12

(For completeness) And even shorter:

SHOW data_directory;
Sign up to request clarification or add additional context in comments.

Comments

3
SELECT setting FROM pg_settings WHERE name = 'data_directory'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.