Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine cluster directory from Postgres service

Tags:

postgresql

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?

like image 964
Vincent Marchetti Avatar asked Feb 20 '09 11:02

Vincent Marchetti


1 Answers

(For completeness) And even shorter:

SHOW data_directory;
like image 166
Milen A. Radev Avatar answered Nov 08 '22 10:11

Milen A. Radev