Re: PGDATA on Windows

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: PGDATA on Windows
Date: 2015-06-16 16:48:35
Message-ID: mlpk16$8e7$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Birchall, Austen wrote on 16.06.2015 16:15:
> 1. For 9.4.3 on Windows Server 2008 the installer has installed to:
>
> C:\Program Files (x86)\PostgreSQL\9.4\data
>
> Is this the recommended location

Definitely not.

I thought the Windows installer was long fixed to suggest an more appropriate location.
If it still defaults to "Program Files" I'd call this a bug.

(I personally don't use the installer on Windows, only the ZIP binaries)

> 2. Should PGDATA be set as a system variable and if so to what?

Not necessarily, because you can pass the location when defining the service.

>
> 3. If I try to try pg_ctl manually I get:
>
> C:\Program Files (x86)\PostgreSQL\9.4\bin>pg_ctl -D C:\Program Files (x86)\Post
> greSQL\9.4\data status
> pg_ctl: unrecognized operation mode "Files"
> Try "pg_ctl --help" for more information.
>
> C:\Program Files (x86)\PostgreSQL\9.4\bin>
>
> What is the correct syntax to do this?
>

You need double quotes:

C:\Program Files (x86)\PostgreSQL\9.4\bin>pg_ctl -D "C:\Program Files (x86)\PostgreSQL\9.4\data status"

But again: storing application data in "Program Files" is never a good idea on Windows.

%ProgramData% (usually c:\ProgramData) is a _much_ better choice - or anything else _outside_ "Program Files".

If you run initdb manually you need to make sure that privileges on the directory or set correctly.
This is usually the case for anything outside of "Program Files".

Thomas

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Eugene Vilensky 2015-06-18 13:51:13 postgresql CentOS 7.1 systemd streaming replica startup
Previous Message Daniel Begin 2015-06-16 16:32:08 Re: PGDATA on Windows