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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: 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-11T14:13:23Z
Lists: pgsql-hackers
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. Instead of hard
> coding values like this they should save the value from the postgres
> headers in another variable before undefining it and then restore that
> value after inclusion of the R headers.

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?

			regards, tom lane



Commits

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