Subject: Re: Postgres and CYGWIN environment variable
From: Reini Urban <[email-masked]>
To: [email-masked]
Date: Tue, 13 Apr 2010 14:08:35 +0200
List-Id: <cygwin.cygwin.com>

2010/4/9 Gary Non-kook (allegedly):
>"cygserver must run as service, CYGWIN must contain server." I vaguely
>remembered seeing something about that environment variable recently,
>and sure enough in
>http://www.cygwin.com/cygwin-ug-net/using-cygwinenv.html#cygwinenv-removed-options
>I see "(no)server - ... This option has been removed".
>So... does postgres still require it? I guess not (and will find out
>later when I start "playing").

On cygwin-1.7 the cygserver service does not require CYGWIN=server anymore.
But it requires the service.
Those release notes are still from a cygwin-1.5, where it needed that.

> /usr/share/doc/Cygwin/postgresql-8.2.11.README also says
> "cygrunsrv is not required anymore, pg_ctl has now the service functions
> included.
> cygserver must run as service"
>
> Then at the end
> "For the impatient: install as user (easy)
>    cygrunsrv -S cygserver
>    initdb -D /usr/share/postgresql/data
> ..."
> So.. is that cygrunsrv required, or not?

There are many ways to start a service.
The cygwin way is
  cygrunsrv -S cygserver.
The windows way is
  net start cygserver

> I ask, because I can't do this
>  $ /usr/sbin/initdb -D /usr/share/postgresql/data
> because:
>  The files belonging to this database system will be owned by user "jg".
>  This user must also own the server process.
>
>  The database cluster will be initialized with locales
>   COLLATE:  de_CH.ISO-8859-1
>   CTYPE:    de_CH.ISO-8859-1
>   MESSAGES: en_US.ISO-8859-1
>   MONETARY: de_CH.ISO-8859-1
>   NUMERIC:  de_CH.ISO-8859-1
>   TIME:     de_CH.ISO-8859-1
>  The default database encoding has accordingly been set to LATIN1.
>
>  creating directory /usr/share/postgresql/data ... ok
>  creating subdirectories ... ok
>  selecting default max_connections ... sh: line 1:  2204 Bad system
> call         "/usr/sbin/postgres.exe" --boot -x0 -F -c
> max_connections=100 -c shared_buffers=1000 -c max_fsm_pages=20000
> template1 < "/dev/null" > "/dev/null" 2>&1
>  sh: line 1:  3364 Bad system call         "/usr/sbin/postgres.exe"
> --boot -x0 -F -c max_connections=50 -c shared_buffers=500 -c
> max_fsm_pages=20000 template1 < "/dev/null" > "/dev/null" 2>&1
>
> (doing that after the cygrunsrv works just fine.)

Everything looks fine.
Those "3364 Bad system call" errors ok, it is to test your actual
max_connection limit, 100 then 50.
Since cygwin is the slowest of all known postgresql platforms on earth
the max_connection numbers is between 2 and max 64, realistic is 5-15,
but I heard of systems with 62 doing fine.
64 is a Windows limitation.
-- 
Reini Urban
http://phpwiki.org/           http://murbreak.at/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple