Re: UPDATE 2: Windows XP, Cygwin 1.3.22-1, PostgreSQL 7.3.2,

From: Jason Tishler <jason(at)tishler(dot)net>
To: Frank Seesink <frank(at)mail(dot)wvnet(dot)edu>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: UPDATE 2: Windows XP, Cygwin 1.3.22-1, PostgreSQL 7.3.2,
Date: 2003-05-12 16:39:29
Message-ID: 20030512163929.GE1708@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-cygwin

Frank,

On Fri, May 09, 2003 at 04:12:01PM -0400, Frank Seesink wrote:
> Jason Tishler wrote:
> >Cygwin can "see" any file that Windows can. Just use /cygdrive/$X
> >(where $X is a drive letter such as a, c, d, etc.) to access files
> >which are not located under / (i.e., C:\Cygwin).
>
> Yep, my bad. Never actually fully realized that, ya know? As I
> didn't see 'cygdrive' at the root level in the BASH shell, didn't
> occur to me. Always noticed it in the PATH within BASH though.
> Thanks. Learn something new every day.

I always create a /cygdrive (actually /mnt) on my Cygwin boxes so bash's
tab completion works on these kinds of paths too. Just another stupid
Cygwin trick... :,)

> >>3. Add 'C:\cygwin\bin' to the system PATH environment variable.
> >>[snip]
> >> * Carefully edit the 'Variable value:' field and add an entry
> >> for C:\Cygwin\bin. I recommend adding it after the Windows
> >> system paths.
> >
> >
> >I recommend adding it before the Windows systems paths, but I'm a
> >Cygwin bigot. :,) Nevertheless, PostgreSQL will have problems
> >finding sort, find, etc. if the Cygwin path is added after instead of
> >before.
>
> Is this actually true?

Yes, AFAICT.

> I notice that if I look at the environment table from a DOS shell,
> C:\cygwin\bin is listed after the Windows system paths (the way I set
> it). However, if I run the BASH shell, I see that Cygwin
> automatically puts its own paths first, before tacking on the NT
> environment table version of PATH; e.g.,
>
> From within BASH:
> PATH='/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINDOWS/system32:...

IIRC, Cygwin's /etc/profile does the above. Note that I use my own
/etc/profile that predates the Cygwin one so I'm not 100% sure. But,
what else would set PATH as such?

> The big question, I guess is, when 'postmaster' runs as an NT service,
> does it run within the Cygwin 'shell' (giving it access to the 'sort'
> and 'find' it expects),

No.

> or does it run in the NT context, where it suddenly accesses the NT
> utilities 'sort' and 'find'?

Kinda. It runs in the postgres context (or whatever user is assigned to
the postmaster service) which will use the PATH defined for that user.

However, you made me think of another option which may suit some users
better. Add the Cygwin bin directories to the end of the Windows system
PATH. But, use cygrunsrv's --env option when installing postmaster and
set postmaster's PATH so that the Cygwin bin directories are searched
first. In this way, one does not need to affect the Windows system PATH
or any user's PATH (including postgres) just to keep postmaster happy.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6

In response to

Responses

Browse pgsql-cygwin by date

  From Date Subject
Next Message Jason Tishler 2003-05-12 16:43:20 Re: vacuumdb and pg_dump are not running under cron
Previous Message Jeff Lu 2003-05-12 16:29:50 Re: vacuumdb and pg_dump are not running under cron