Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3My1-00015L-Ch for pgsql-committers@arkaria.postgresql.org; Tue, 13 Jul 2021 18:17:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3My0-0000va-DR for pgsql-committers@arkaria.postgresql.org; Tue, 13 Jul 2021 18:17:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3My0-0000v4-7V for pgsql-committers@lists.postgresql.org; Tue, 13 Jul 2021 18:17:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3Mxu-0004o4-39 for pgsql-committers@lists.postgresql.org; Tue, 13 Jul 2021 18:17:11 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 16DIH4L13279998; Tue, 13 Jul 2021 14:17:04 -0400 From: Tom Lane To: Thomas Munro cc: pgsql-committers Subject: Re: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command. In-reply-to: <3278308.1626198027@sss.pgh.pa.us> References: <3187588.1626136248@sss.pgh.pa.us> <3189569.1626138591@sss.pgh.pa.us> <3198323.1626149748@sss.pgh.pa.us> <3278308.1626198027@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 13 Jul 2021 13:40:27 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3279996.1626200224.1@sss.pgh.pa.us> Date: Tue, 13 Jul 2021 14:17:04 -0400 Message-ID: <3279997.1626200224@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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]: *** [: 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