Re: pg_regress in C

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: pg_regress in C
Date: 2006-07-19 02:46:04
Message-ID: 8373.1153277164@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

"Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
> Per discussion at the conference:
> In order to run the regression tests on Windows without msys, pg_regress
> needs to be reimplemnted in C.

Patch committed after significant further work. As committed,
pg_regress.c is pretty nearly an exact replacement for the shell script;
the only significant deviation is that the --temp_install switch's
argument is required not optional. (This is because our homegrown
version of getopt_long doesn't allow optional arguments. Maybe that
should be fixed sometime.)

There is one possibly important loose end: the shell script makes an
effort to catch signals and shut down the temp postmaster before
exiting, while there's no such code in the C version. I'm not sure
if it's necessary. At least on my machine, if you type control-C while
the tests are running then the kernel sends SIGINT to everything that's
part of the terminal's process group, which will include the postmaster
--- so the shutdown happens anyway. I have no idea if that'll work on
Windows... One reason I didn't try to do this is I'm a bit hesitant to
write a signal handler that does anything as interesting as a system()
call, which would seem to be necessary to duplicate what the shell
script did. Comments?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-07-19 02:52:02 Re: modular pg_regress.sh
Previous Message Alvaro Herrera 2006-07-19 01:57:19 Re: RESET CONNECTION?

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-07-19 02:52:02 Re: modular pg_regress.sh
Previous Message Christopher Kings-Lynne 2006-07-19 01:20:29 Re: [HACKERS] 8.2 features?