Re: BUG #16176: NULL value returned by category_sql argument to crosstab() causes segmentation fault - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16176: NULL value returned by category_sql argument to crosstab() causes segmentation fault
Date
Msg-id 24798.1577131592@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #16176: NULL value returned by category_sql argument tocrosstab() causes segmentation fault  (Joe Conway <mail@joeconway.com>)
List pgsql-bugs
Joe Conway <mail@joeconway.com> writes:
> On 12/23/19 1:49 PM, Tom Lane wrote:
>> Hmm, why'd you use ERRCODE_SYNTAX_ERROR, and not say
>> ERRCODE_NULL_VALUE_NOT_ALLOWED?

> To be consistent with the error just above:
> ...
> But I am not married to ERRCODE_SYNTAX_ERROR if you think it ought to be
> changed.

Meh.  (a) ERRCODE_SYNTAX_ERROR is awfully generic, and thereby not very
helpful; (b) it seems hard to me to paint the problem here as being any
form of "syntax" error.

And for that matter, "syntax error" is a crappy classification of the
error just above, too.  IMO it ought to fall under "data exception".
We don't seem to have an errcode for "wrong number of columns",
but maybe we should invent one --- I think the same issue arises in
other places.  Or we could just use generic ERRCODE_DATA_EXCEPTION.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Joe Conway
Date:
Subject: Re: BUG #16176: NULL value returned by category_sql argument tocrosstab() causes segmentation fault
Next
From: Thomas Munro
Date:
Subject: Re: BUG #16104: Invalid DSA Memory Alloc Request in Parallel Hash