Re: BUG #16176: NULL value returned by category_sql argument tocrosstab() causes segmentation fault

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: BUG #16176: NULL value returned by category_sql argument tocrosstab() causes segmentation fault
Дата
Msg-id 5103290c-be78-bb9c-eef2-eeeecee0bf23@joeconway.com
обсуждение исходный текст
Ответ на Re: BUG #16176: NULL value returned by category_sql argument to crosstab() causes segmentation fault  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #16176: NULL value returned by category_sql argument to crosstab() causes segmentation fault  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On 12/23/19 1:49 PM, Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>> Pushed that way to all supported branches.
>
> Hmm, why'd you use ERRCODE_SYNTAX_ERROR, and not say
> ERRCODE_NULL_VALUE_NOT_ALLOWED?

To be consistent with the error just above:
--------------------
/*
 * The provided categories SQL query must always return one column:
 * category - the label or identifier for each column
 */
if (spi_tupdesc->natts != 1)
    ereport(ERROR,
    (errcode(ERRCODE_SYNTAX_ERROR),
     errmsg("provided \"categories\" SQL must " \
    "return 1 column of at least one row")));
--------------------

Also, the argument itself is a SQL statement, and it isn't NULL, it just
produces a NULL value as one (or more) of its output rows. It seems like
ERRCODE_NULL_VALUE_NOT_ALLOWED might be confusing.

But I am not married to ERRCODE_SYNTAX_ERROR if you think it ought to be
changed.

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


Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16176: NULL value returned by category_sql argument to crosstab() causes segmentation fault
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16176: NULL value returned by category_sql argument to crosstab() causes segmentation fault