pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedunbale to use pg_ctl in Windows Cmd.
7+ messages / 4 participants
[nested] [flat]
* unbale to use pg_ctl in Windows Cmd.
@ 2020-12-05 17:02 mark armon <1994hejian@gmail.com>
0 siblings, 2 replies; 7+ messages in thread
From: mark armon @ 2020-12-05 17:02 UTC (permalink / raw)
To: pgsql-admin
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 *system
variable* In windows setting. But still not working. In the *bin* directory,
there is *pg_ctl.exe* file.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: unbale to use pg_ctl in Windows Cmd.
@ 2020-12-05 17:24 Scott Ribe <scott_ribe@elevated-dev.com>
parent: mark armon <1994hejian@gmail.com>
1 sibling, 1 reply; 7+ messages in thread
From: Scott Ribe @ 2020-12-05 17:24 UTC (permalink / raw)
To: mark armon <1994hejian@gmail.com>; +Cc: pgsql-admin
> On Dec 5, 2020, at 10:02 AM, mark armon <1994hejian@gmail.com> wrote:
>
> I don't know where the pg_data directory.
You will have to find it to use pg_ctl
> So I set the C:\Users\Think\Desktop\postgres\data as user variable and system variable In windows setting.
Doesn't do any good if that's not where the data directory is.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: unbale to use pg_ctl in Windows Cmd.
@ 2020-12-05 21:22 Ron <ronljohnsonjr@gmail.com>
parent: mark armon <1994hejian@gmail.com>
1 sibling, 1 reply; 7+ messages in thread
From: Ron @ 2020-12-05 21:22 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
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 *system
> variable* 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 where the data is.
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: unbale to use pg_ctl in Windows Cmd.
@ 2020-12-05 21:40 Paul Förster <paul.foerster@gmail.com>
parent: Ron <ronljohnsonjr@gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Paul Förster @ 2020-12-05 21:40 UTC (permalink / raw)
To: Ron <ronljohnsonjr@gmail.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
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 system variable 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 where the 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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: unbale to use pg_ctl in Windows Cmd.
@ 2020-12-05 22:24 Ron <ronljohnsonjr@gmail.com>
parent: Paul Förster <paul.foerster@gmail.com>
0 siblings, 0 replies; 7+ messages in thread
From: Ron @ 2020-12-05 22:24 UTC (permalink / raw)
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
On 12/5/20 3:40 PM, Paul Förster wrote:
> 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 system variable 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 where the 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)
Using Cortana (or good old "DIR/S") to find PG_VERSION should work. I'd be
shocked if it didn't...
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: unbale to use pg_ctl in Windows Cmd.
@ 2020-12-06 08:02 mark armon <1994hejian@gmail.com>
parent: Scott Ribe <scott_ribe@elevated-dev.com>
0 siblings, 1 reply; 7+ messages in thread
From: mark armon @ 2020-12-06 08:02 UTC (permalink / raw)
To: Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: pgsql-admin
Problem resolved. But I just don’t know why.
So I need to add the data directory. like pg_ctl status -D 'C:\Program
Files\PostgreSQL\13\data'
On Sat, Dec 5, 2020 at 10:54 PM Scott Ribe <scott_ribe@elevated-dev.com>
wrote:
> > On Dec 5, 2020, at 10:02 AM, mark armon <1994hejian@gmail.com> wrote:
> >
> > I don't know where the pg_data directory.
>
> You will have to find it to use pg_ctl
>
> > So I set the C:\Users\Think\Desktop\postgres\data as user variable and
> system variable In windows setting.
>
> Doesn't do any good if that's not where the data directory is.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: unbale to use pg_ctl in Windows Cmd.
@ 2020-12-06 08:16 Ron <ronljohnsonjr@gmail.com>
parent: mark armon <1994hejian@gmail.com>
0 siblings, 0 replies; 7+ messages in thread
From: Ron @ 2020-12-06 08:16 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
You've got to do it because Postgresql requires you to.
Or you could set PGDATA=|C:\Program Files\PostgreSQL\13\data'|and run
|pg_ctl status|, just like the error message aid.
On 12/6/20 2:02 AM, mark armon wrote:
>
> Problem resolved. But I just don’t know why.
> So I need to add the data directory. like |pg_ctl status -D 'C:\Program
> Files\PostgreSQL\13\data'|
>
>
>
> On Sat, Dec 5, 2020 at 10:54 PM Scott Ribe <scott_ribe@elevated-dev.com
> <mailto:scott_ribe@elevated-dev.com>> wrote:
>
> > On Dec 5, 2020, at 10:02 AM, mark armon <1994hejian@gmail.com
> <mailto:1994hejian@gmail.com>> wrote:
> >
> > I don't know where the pg_data directory.
>
> You will have to find it to use pg_ctl
>
> > So I set the C:\Users\Think\Desktop\postgres\data as user variable
> and system variable In windows setting.
>
> Doesn't do any good if that's not where the data directory is.
>
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2020-12-06 08:16 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-05 17:02 unbale to use pg_ctl in Windows Cmd. mark armon <1994hejian@gmail.com>
2020-12-05 17:24 ` Scott Ribe <scott_ribe@elevated-dev.com>
2020-12-06 08:02 ` mark armon <1994hejian@gmail.com>
2020-12-06 08:16 ` Ron <ronljohnsonjr@gmail.com>
2020-12-05 21:22 ` Ron <ronljohnsonjr@gmail.com>
2020-12-05 21:40 ` Paul Förster <paul.foerster@gmail.com>
2020-12-05 22:24 ` Ron <ronljohnsonjr@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox