Re: How do I determine my data dir for a created database for pg_ctl? - Mailing list pgsql-novice

From Barbara Figueirido
Subject Re: How do I determine my data dir for a created database for pg_ctl?
Date
Msg-id 48AC72C1.8000408@bariloche.com.ar
Whole thread Raw
In response to How do I determine my data dir for a created database for pg_ctl?  ("Matthew Pettis" <matthew.pettis@gmail.com>)
Responses Re: How do I determine my data dir for a created database for pg_ctl?
List pgsql-novice
Matthew Pettis wrote:
> Hi,
>
> I have a database I can psql into... How can I determine what its
> absolute path is so I can use pg_ctl on it to restart it?  Because
> when I use pg_ctl, it tells me I have to provide it in the -D flag as
> an argument.
>
> Thanks,
> matt
>

Hi. I'm quite a novice, but I think I can help. In need of determining
the path to the data, I use an indirect method: since different
distributions have different paths, I try to locate the pg_hba.conf
file, which resides on the same directory as your data (with the command
"find / -name 'pg_hba.conf'" (without the double quotes) issued as root).
But since your postmaster is running, I would rather try the following:

ps auwx |grep postmaster

this tells you whether it is in fact running, and if it is, tells you
also the path where the -D flag points to.

Hope this is somehow useful. Best regards,
Barbara

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Restarting with pg_ctl, users, and passwords.
Next
From: "Matthew Pettis"
Date:
Subject: Re: How do I determine my data dir for a created database for pg_ctl?