Re: Postgres: Packaging & Server Startup - Mailing list pgsql-general

From Richard Huxton
Subject Re: Postgres: Packaging & Server Startup
Date
Msg-id 49D1FDA9.7030000@archonet.com
Whole thread Raw
In response to Re: Postgres: Packaging & Server Startup  (CM J <postgres.newbie@gmail.com>)
List pgsql-general
CM J wrote:
> Hi,
>
> I don't have multiple postgres installed.

Hmm. OK.

> Anyway, tried your suggestion
> to use the full path name and here is what i get:
>
> D:\pgsql\bin>D:\pgsql\bin\pg_ctl.exe -U postgres -P <mypasswd> -w start
> -D:\pgsql\data

You've got a typo here - the "-D" has run into "D:\..."

> pg_ctl: could not open PID file ":/pgsql/data/postmaster.pid": Invalid
> argument
>
>        There is no data directory created by default (i used
> no-installer-zip file to install postgres), so i went ahead and created a
> dummy data directory which gave the same result as above. Any suggestions ??

It's probably worth checking the permissions on that directory, but I
don't think it's the problem here. You have run "initdb" on that
directory though, haven't you? If not, do that before worrying about the
rest of this email.

>>> pg_ctl.exe -U postgres -P <mypasswd>  -w start -D D:\pgsql\data
>>>
>>>         However, i get the following error message:
>>>
>>> waiting for server to start...FATAL:  postgres: could not locate matching
>>> postgres executable

Reading the error message and searching the source-code for it (always
worth having a copy of the source, even if you don't read "C") I found
that the error message isn't being produced by pg_ctl. It's being
produced by "postgres" - the backend itself.

It's checking that it's version number matches the version number
reported by running /path/to/my/dir/postgres.exe -V (grab the source and
have a look in port/exec.c at about line 395).

Now, that means one of three things:
1. It can't reach the "current directory" (permissions)
2. It can't run postgres (permissions)
3. The version-string is incorrect.

I don't see how #2 is possible (pg_ctl has started postgres.exe fine) so
that leaves #1 or #3. The third is easy to check run "postgres.exe -V"
yourself and see what it says.

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: CM J
Date:
Subject: Re: Postgres: Packaging & Server Startup
Next
From: Alban Hertroys
Date:
Subject: Re: [GENEAL] dynamically changing table