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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: ipluta(at)wp(dot)pl, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16176: NULL value returned by category_sql argument to crosstab() causes segmentation fault
Date: 2019-12-23 20:06:32
Message-ID: 24798.1577131592@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Joe Conway <mail(at)joeconway(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2019-12-24 00:29:13 Re: BUG #16104: Invalid DSA Memory Alloc Request in Parallel Hash
Previous Message Joe Conway 2019-12-23 19:00:38 Re: BUG #16176: NULL value returned by category_sql argument to crosstab() causes segmentation fault