Re: PL/R regression on windows, but not linux with master. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PL/R regression on windows, but not linux with master.
Date
Msg-id 2672048.1618155242@sss.pgh.pa.us
Whole thread Raw
In response to Re: PL/R regression on windows, but not linux with master.  (Joe Conway <mail@joeconway.com>)
Responses Re: PL/R regression on windows, but not linux with master.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> On 4/11/21 10:13 AM, Tom Lane wrote:
>> Indeed.  elog.h already provides a "PGERROR" macro to use for restoring
>> the value of ERROR.  We have not heard of a need to do anything special
>> for WARNING though --- maybe that's R-specific?

> R also defines WARNING in its headers.

Ah.

> Would an equivalent "PGWARNING" be something we are open to adding and 
> back-patching?

It's not real obvious how pl/r could solve this in a reliable way
otherwise, so adding that would be OK with me, but I wonder whether
back-patching is going to help you any.  You'd still need to compile
against older headers I should think.  So I'd suggest

(1) add PGWARNING in HEAD only

(2) in pl/r, do something like
    #ifndef PGWARNING
    #define PGWARNING 19
    #endif
which should be safe since it's that in all previous supported
versions.

Also, I notice that elog.h is wrapping PGERROR in #ifdef WIN32,
which might be an overly constricted view of when it's helpful.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: psql - add SHOW_ALL_RESULTS option
Next
From: Peter Geoghegan
Date:
Subject: Re: PANIC: wrong buffer passed to visibilitymap_clear