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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PL/R regression on windows, but not linux with master.
Дата
Msg-id 2672048.1618155242@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PL/R regression on windows, but not linux with master.  (Joe Conway <mail@joeconway.com>)
Ответы Re: PL/R regression on windows, but not linux with master.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: psql - add SHOW_ALL_RESULTS option
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: PANIC: wrong buffer passed to visibilitymap_clear