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

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Dave Cramer <davecramer(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: PL/R regression on windows, but not linux with master.
Date: 2021-04-11 12:04:51
Message-ID: c1bf8d44-aee9-6f5a-7207-757b835956fc@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 4/10/21 8:56 PM, Tomas Vondra wrote:
> On 4/11/21 2:38 AM, Dave Cramer wrote:
>>
>>
>>
>> On Sat, 10 Apr 2021 at 20:34, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us
>> <mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>> wrote:
>>
>> Dave Cramer <davecramer(at)gmail(dot)com <mailto:davecramer(at)gmail(dot)com>> writes:
>> > On Sat, 10 Apr 2021 at 20:24, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us
>> <mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>> wrote:
>> >> That's quite bizarre.  What is the actual error level according to
>> >> the source code, and where is the error being thrown exactly?
>>
>> > Well it really is an ERROR, and is being downgraded on windows to
>> WARNING.
>>
>> That seems quite awful.
>>
>> However, now that I think about it, the elog.h error-level constants
>> were renumbered not so long ago.  Maybe you've failed to recompile
>> everything for v14?
>>
>>
>> We see this on a CI with a fresh pull from master.
>>
>> As I said I will dig into it and figure it out. 
>>
> Well, plr.h does this:
>
> #define WARNING 19
> #define ERROR 20
>
> which seems a bit weird, because elog.h does this (since 1f9158ba481):
>
> #define WARNING 19
> #define WARNING_CLIENT_ONLY 20
> #define ERROR 21
>
> Not sure why this would break Windows but not Linux, though.
>
>

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. That would work across versions
even if we renumber them.

cheers

andrew

--

Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2021-04-11 13:28:21 Re: Add header support to text format and matching feature
Previous Message Rémi Lapeyre 2021-04-11 11:01:22 Re: Add header support to text format and matching feature