Re: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command.
Date: 2021-07-14 16:07:07
Message-ID: 3516221.1626278827@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Thomas Munro <thomas(dot)munro(at)gmail(dot)com> writes:
> I decided to try to make it work properly on that OS instead of the
> hacky solution now that I have access. I took your last patch, moved
> -D_POSIX_PTHREAD_SEMANTICS into CFLAGS in src/template/solaris,

Aha! Yeah, just defining _POSIX_PTHREAD_SEMANTICS unconditionally
on Solaris seems like a good idea. However, messing with the template
file is not the best way to inject that, because if the user specifies
CFLAGS then the template file's setting is ignored. It's better to
handle it in the part of configure.ac that automatically adds flags
onto whatever the user or template file gave. Also, being a -D
switch, it really oughta go into CPPFLAGS not CFLAGS.

I've tested the attached on the GCC farm's Solaris machine (which
I believe is the same machine wrasse runs on), and it seems OK.
I think it's ready to go.

> I can't find any evidence on the 'net that any other OS
> cares about _POSIX_PTHREAD_SEMANTICS (every reference says it's a
> Solaris thing) so this should just remove some useless clutter,

Agreed; if we do find any other platforms that need it, we can extend
the PORTNAME check used here.

> Another thing
> I noticed is that config/ax_pthread.m4 (something from autoconf that
> we don't want to modify) will add another copy of
> -D_POSIX_PTHREAD_SEMANTICS, but that's already the case.

Ah, yeah, I see:

$ grep POSIX src/Makefile.global
PTHREAD_CFLAGS = -D_POSIX_PTHREAD_SEMANTICS -pthread -D_REENTRANT -D_THREAD_SAFE
CPPFLAGS = -D_POSIX_PTHREAD_SEMANTICS
Seems pretty harmless, and anyway we have to make sure this gets in there
whether or not --enable-thread-safety is given.

regards, tom lane

Attachment Content-Type Size
v4-0001-Portability-fixes-for-sigwait.patch text/x-diff 10.7 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-07-14 18:15:21 pgsql: Copy a Param's location field when replacing it with a Const.
Previous Message John Naylor 2021-07-14 14:02:24 pgsql: Remove unused function parameter in get_qual_from_partbound