Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: pg_ctl strangeness under msys


  • From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
  • To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
  • Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers-win32 <pgsql-hackers-win32(at)postgresql(dot)org>
  • Subject: Re: pg_ctl strangeness under msys
  • Date: Tue, 26 Oct 2004 10:18:48 -0400 (EDT)
  • Message-id: <200410261418(dot)i9QEImQ06083(at)candle(dot)pha(dot)pa(dot)us>

Bruce Momjian wrote:
> Magnus Hagander wrote:
> > > I have seen some strange things using pg_ctl under MSys:
> > > 
> > > . "pg_ctl status" from the command line logs to the event log. 
> > > Apparently it thinks it's not on a tty. Works fine from 
> > > Windows cmd prompt.
> > > . this hangs: perl -e '@foo=`pg_ctl -w start`;'
> > >   but this doesn't: perl -e 'system("pg_ctl -w start");'
> > > 
> > > Finding the problem with the last one has cost me hours in 
> > > trying to get the buildfarm to run.
> > > 
> > > Anyone have ideas about ways to fix? Or do we just note it 
> > > and live with it?
> > 
> > As I'm sure you are already aware we've had a lot of problems with the
> > msys console. Buffernig and others. I think we at some point decided to
> > say that minor issues on the win32 consoles isn't really something we're
> > concerned about, people will run things from the cmd console in 99.9% of
> > all cases.
> > 
> > Not sure how to fix it. The eventlog checking code uses isatty() IIRC,
> > and that one is clearly returning the wrong thing on msys. Not sure how
> > to code around that.
> 
> We actually added the ability to turn the psql pager always on to fix a
> problem with a Win32 user running psql inside some kind of application
> (emacs?) where isatty returned the wrong value.  I don't see any clean
> workaround here though.

Have you tried:

	pg_ctl start 2>/dev/tty

that would force stderr to go to the tty.  This might help because the
pg_ctl.c test is:

	    if (!isatty(fileno(stderr)))    /* Running as a service */

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group