Re: PostgreSQL in Windows console and Ctrl-C - Mailing list pgsql-hackers

From Noah Misch
Subject Re: PostgreSQL in Windows console and Ctrl-C
Date
Msg-id 20140630202706.GB1500258@tornado.leadboat.com
Whole thread Raw
In response to Re: PostgreSQL in Windows console and Ctrl-C  (Christian Ullrich <chris@chrullrich.net>)
Responses Re: PostgreSQL in Windows console and Ctrl-C  (Christian Ullrich <chris@chrullrich.net>)
List pgsql-hackers
On Mon, Jun 30, 2014 at 07:28:03PM +0000, Christian Ullrich wrote:
> * From: Noah Misch [mailto:noah@leadboat.com]
> 
> > I liked the proposal here; was there a problem with it?
> > http://www.postgresql.org/message-
> > id/CA+TgmoZ3aKE4EnCTmQmZSyKC_0pjL_u4C_x47GE48uY1upBNxg@mail.gmail.com
> 
> You're referring to the suggestion of accepting and ignoring the option on
> non-Windows, right? I can do that, I just don't see the point as long as
> pg_ctl has a separate code path (well, #ifdef) for Windows anyway.

Yes.  We normally recognize platform-specific options on every platform.  For
example, the effective_io_concurrency GUC exists on all platforms, but you can
only change it on platforms where it matters.  In that light, one could argue
for raising an error for --background on non-Windows systems.  I don't have a
strong opinion on raising an error vs. ignoring the option, but I do think the
outcome of --background should be distinguishable from the outcome of
--sometypo on all platforms.

> > The pg_upgrade test suite and the $(prove_check)-based test suites rely on
> > their pg_ctl-started postmasters receiving any console ^C.  pg_ctl
> > deserves a --foreground or --no-background option for callers that prefer
> > the current behavior.  That, or those tests need a new way to launch the
> > postmaster.
> 
> Ah. More good news. Just to confirm, this is only about the tests, right,
> not the code they are testing?

Yes; the consequence of ignoring ^C is that the test postmaster would persist
indefinitely after the ^C.  The system under test doesn't care per se, but
future test runs might fail strangely due to the conflicting postmaster.  The
user running the tests won't appreciate the clutter in his process list.

> If so, is there even a way to run either on Windows? The pg_upgrade test
> suite is a shell script, and prove_check is defined in Makefile.global and 
> definitely not applicable to Windows.

contrib/pg_upgrade/test.sh works under MSYS.  Perhaps $(prove_check) currently
doesn't, but that's something to be fixed, not relied upon.  There's a clone
of contrib/pg_upgrade/test.sh in src/tools/msvc/vcregress.pl, and I expect it
would have the same problem.

Thanks,
nm

-- 
Noah Misch
EnterpriseDB                                 http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: better atomics - v0.5
Next
From: Heikki Linnakangas
Date:
Subject: Re: WAL format and API changes (9.5)