On 4/11/21 10:13 AM, Tom Lane wrote:
Andrew Dunstan <and...@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