Re: PL/R regression on windows, but not linux with master.

Joe Conway <mail@joeconway.com>

From: Joe Conway <mail@joeconway.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Andrew Dunstan <andrew@dunslane.net>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>, Dave Cramer <davecramer@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-04-11T15:01:54Z
Lists: pgsql-hackers
On 4/11/21 10:13 AM, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>>> Well, plr.h does this:
>>> 
>>> #define WARNING		19
>>> #define ERROR		20
> 
>> The coding pattern in plr.h looks quite breakable.

Meh -- that code has gone 18+ years before breaking.

> 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. If I remember correctly there are (or at 
least were, it *has* been 18+ years since I looked at this particular thing) 
some odd differences in the R headers under Windows and Linux.

In any case we would be happy to use "PGERROR".

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

Joe

-- 
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development



Commits

  1. Add macro PGWARNING, and make PGERROR available on all platforms.