Re: PGDATA on Windows

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: PGDATA on Windows
Дата
Msg-id mlpk16$8e7$1@ger.gmane.org
обсуждение исходный текст
Ответ на PGDATA on Windows  ("Birchall, Austen" <austen.birchall@metoffice.gov.uk>)
Список 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


В списке pgsql-novice по дате отправления:

Предыдущее
От: Daniel Begin
Дата:
Сообщение: Re: PGDATA on Windows
Следующее
От: Eugene Vilensky
Дата:
Сообщение: postgresql CentOS 7.1 systemd streaming replica startup