Sample Header Ad - 728x90

How to programmatically find the PostgreSQL data directory?

0 votes
1 answer
1187 views
I'm creating an installer for my program and I'd like to check if the database already exists in the computer. I do this by calling psql -lqt | findstr dbname. If someone knows a better way I`ll be glad to learn it. Well, now I know if the database exists, but I would also like to know where its data directory is. Is there a programmatic way to find this out?
Asked by Leandro Lima (101 rep)
Dec 7, 2015, 07:40 PM
Last activity: Feb 1, 2024, 11:02 PM