Re: unbale to use pg_ctl in Windows Cmd. - Mailing list pgsql-admin

From Paul Förster
Subject Re: unbale to use pg_ctl in Windows Cmd.
Date
Msg-id 3FCC3330-1DC3-4C22-8952-DDB84B0E003B@gmail.com
Whole thread Raw
In response to Re: unbale to use pg_ctl in Windows Cmd.  (Ron <ronljohnsonjr@gmail.com>)
Responses Re: unbale to use pg_ctl in Windows Cmd.  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-admin
Hi Mark, hi Ron,

> On 05. Dec, 2020, at 22:22, Ron <ronljohnsonjr@gmail.com> wrote:
>
> On 12/5/20 11:02 AM, mark armon wrote:
>> pg_ctl status
>> pg_ctl: no database directory specified and environment variable PGDATA unset
>> Try "pg_ctl
>> --help" for more information.
>>
>>
>> C:\Users\Think>pg_ctl
>> --help
>>
>> pg_ctl is a utility to initialize,
>> start, stop, or control a PostgreSQL server.
>>
>> I don't know where the pg_data directory. So I set the C:\Users\Think\Desktop\postgres\data as user variable and
systemvariable In windows setting. But still not working. In the bin directory, there is pg_ctl.exe file. 
>
> Randomly deciding on a directory because you don't know where the data actually is doesn't work.  You need to know
wherethe data is. 

maybe this helps with locating PGDATA. If you can connect you can ask the database where PGDATA is:

postgres=# show data_directory;
   data_directory
---------------------
 /data/pg01/sdb01/db
(1 row)

Cheers,
Paul


pgsql-admin by date:

Previous
From: Ron
Date:
Subject: Re: unbale to use pg_ctl in Windows Cmd.
Next
From: Ron
Date:
Subject: Re: unbale to use pg_ctl in Windows Cmd.