Defining a cluster directory from Postgres

Is it possible to determine the cluster directory used by the Postgres server from the server itself - that is, the service (under Windows) is started using the following:

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

Is there a query or SELECT function that can be executed on the current server to get the value D:\emr\data ?

+4
source share
2 answers

(For completeness) And even shorter:

 SHOW data_directory; 
+6
source
 SELECT setting FROM pg_settings WHERE name = 'data_directory' 
+2
source

All Articles