From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command.
Date: Tue, 13 Jul 2021 14:17:04 -0400
Message-ID: <3279997.1626200224@sss.pgh.pa.us> (raw)
In-Reply-To: <3278308.1626198027@sss.pgh.pa.us>
References: <E1m35jw-0006Gi-Qg@gemulon.postgresql.org>
<3187588.1626136248@sss.pgh.pa.us>
<CA+hUKGLpSgVmD1jMpBcsjnXun3jNxG+6dYzpocxOz3R6Z8n9rA@mail.gmail.com>
<3189569.1626138591@sss.pgh.pa.us>
<CA+hUKGKDKXEfkQR5HsG7pq7oLaH366zqyMuRE4DMg2=Hb_C1GQ@mail.gmail.com>
<3198323.1626149748@sss.pgh.pa.us>
<CA+hUKGJCLgEbaHMeCDetu+PwSy5v5N2x4gd_suAjNiBnPe+bXw@mail.gmail.com>
<CA+hUKGKOFSKvc2xo_Yw2PKhefcj47tZyL3_BC23kybDLgNJ-gw@mail.gmail.com>
<CA+hUKGJoVSXU5xFoLUTfbZHLwtJWjnhK9Q3yULM5HL7jVLc8nw@mail.gmail.com>
<3278308.1626198027@sss.pgh.pa.us>
I wrote:
> Here's a revised patch that I've tested (albeit lightly) on
> both HPUX and Solaris.
Hm, I'd verified the configure results, but I didn't wait around
for the builds to finish, which was a mistake. On Solaris 11:
command.c: In function 'do_watch':
command.c:5062:8: error: too many arguments to function 'sigwait'
if (sigwait(&sigalrm_sigchld_sigint, &signal_received) < 0)
^
In file included from ../../../src/include/fe_utils/print.h:16:0,
from command.h:12,
from command.c:28:
/usr/include/signal.h:233:12: note: declared here
extern int sigwait(sigset_t *);
^
gmake[3]: *** [<builtin>: command.o] Error 1
gmake[2]: *** [Makefile:43: all-psql-recurse] Error 2
gmake[1]: *** [Makefile:42: all-bin-recurse] Error 2
gmake: *** [GNUmakefile:11: all-src-recurse] Error 2
What is happening is obvious in retrospect. Per my patch, configure
checks how sigwait is declared with -D_POSIX_PTHREAD_SEMANTICS, and
that's also how libpq's reference is compiled ... but psql's reference
is not compiled that way. It seems to work if we force command.c
to be compiled with PTHREAD_CFLAGS added, but that is really quite
grotty. I think it'd be safer to push the sigwait reference out
into a separate file to minimize the scope of those flags.
Just how badly did you want to use sigwait here? I'm having
considerable second thoughts about the value of that change
versus the hoops we're going to have to jump through to use it.
(I suppose a hacky solution might be to never define USE_SIGWAIT
on Solaris.)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, thomas.munro@gmail.com
Subject: Re: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command.
In-Reply-To: <3279997.1626200224@sss.pgh.pa.us>
References: <E1m35jw-0006Gi-Qg@gemulon.postgresql.org> <3187588.1626136248@sss.pgh.pa.us> <CA+hUKGLpSgVmD1jMpBcsjnXun3jNxG+6dYzpocxOz3R6Z8n9rA@mail.gmail.com> <3189569.1626138591@sss.pgh.pa.us> <CA+hUKGKDKXEfkQR5HsG7pq7oLaH366zqyMuRE4DMg2=Hb_C1GQ@mail.gmail.com> <3198323.1626149748@sss.pgh.pa.us> <CA+hUKGJCLgEbaHMeCDetu+PwSy5v5N2x4gd_suAjNiBnPe+bXw@mail.gmail.com> <CA+hUKGKOFSKvc2xo_Yw2PKhefcj47tZyL3_BC23kybDLgNJ-gw@mail.gmail.com> <CA+hUKGJoVSXU5xFoLUTfbZHLwtJWjnhK9Q3yULM5HL7jVLc8nw@mail.gmail.com> <3278308.1626198027@sss.pgh.pa.us> <3279997.1626200224@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox