Re: [pgsql-general] cant find postgres executable after initdb

From: "Willy-Bas Loos" <willybas(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [pgsql-general] cant find postgres executable after initdb
Date: 2008-11-06 12:10:28
Message-ID: 1dd6057e0811060410p39e2a020r5b3d83ce17511a55@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ok, when i start a new cmd window from runas, and run the pg_ctl command
from there, the process will start.
btw you also have to change the ownership and permissions on the
postgresql.conf, pg_hba.conf and pg_ident.conf files.

C:\Program Files\PostgreSQL\8.3\bin>runas /user:postgres2 "cmd /k"
Will open a cmd window that stays open.
It starts in the wron folder, so i change it to the Postgres bin. From there
i can run the pg_ctl command and it works.
It also works when i use pg_ctl register as an admin user, specipying the -U
and -P options.
BTW this is all on Windows NT 4.0

It works now, but i think the error message could be improved somewhat.

cheers,

WBL

On Wed, Nov 5, 2008 at 2:36 PM, Willy-Bas Loos <willybas(at)gmail(dot)com> wrote:

> Hi,
>
> I have a pgsql 8.3.3 cluster running on windows.
> I want to install another cluster, so i use initdb.
> Because the postgres user must own the files, i use runas to run initdb as
> postgres2 (the correct user here).
> I've created a separate folder for the data files of this cluster. The
> folder is owned by the admin user, but posgres2 has full control of it (ok,
> maybe i should squeeze that down a little strictly speaking)
> As far as i can see, that is the preferred way to create a cluster in ms
> windows. Is that correct?
>
> The resulting cluster does not start with pg_ctl. The postgres executable
> is in the bin folder, just like pg_ctl.
> The other cluster is running.
>
> ##====in the cmd window:=====
> C:\Program Files\PostgreSQL\8.3\bin>runas /user:mydomain\postgres2 "initdb
> -D \"C:\Program Files\PostgreSQL\8.3\data_5433\" --no-locale"
> Enter the password for mydomain\postgres2:
> Attempting to start initdb -D "C:\Program Files\PostgreSQL\8.3\data_5433"
> --no-locale as user "mydomain\postgres2" ...
> ## remark from me: starts a new window in which it does initdb. window
> closes after execution :(
>
> C:\Program Files\PostgreSQL\8.3\bin>pg_ctl start -D "C:\Program
> Files\PostgreSQL\8.3\data_5433"
> server starting
> FATAL: postgres: could not locate matching postgres executable
>
> C:\Program Files\PostgreSQL\8.3\bin>pg_ctl start -D "C:\Program
> Files\PostgreSQL\8.3\data_5433" -p "C:\Program
> Files\PostgreSQL\8.3\bin\postgres.exe"
> server starting
> C:\Program Files\PostgreSQL\8.3\bin>FATAL: postgres: could not locate
> matching postgres executable
>
> C:\Program Files\PostgreSQL\8.3\bin>pg_ctl start -D "C:\Program
> Files\PostgreSQL\8.3\data_5433" -o "-p \"C:\Program
> Files\PostgreSQL\8.3\bin\""
> server starting
> FATAL: ongeldige waarde voor parameter "port": "C:\Program
> Files\PostgreSQL\8.3\bin"
>
> C:\Program Files\PostgreSQL\8.3\bin>pg_ctl status -D "C:\Program
> Files\PostgreSQL\8.3\data" ## <-- the other cluster
> pg_ctl: server is running (PID: 2056)
> ##=====================
>
> Cheers,
> WBL
> --
> "Patriotism is the conviction that your country is superior to all others
> because you were born in it." -- George Bernard Shaw
>

--
"Patriotism is the conviction that your country is superior to all others
because you were born in it." -- George Bernard Shaw

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adriana Alfonzo 2008-11-06 13:29:35 Ayuda
Previous Message Ori Garin 2008-11-06 10:17:19 Postgres dies on standby server after triggering failover