Re: BUG #16176: NULL value returned by category_sql argument to crosstab() causes segmentation fault
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joe Conway <mail@joeconway.com>
Cc: ipluta@wp.pl, pgsql-bugs@lists.postgresql.org
Date: 2019-12-23T20:06:32Z
Lists: 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
Commits
-
Disallow null category in crosstab_hash
- 4a3cdb531be5 9.4.26 landed
- 70fc6c4ef3c3 9.5.21 landed
- 3757c164008c 9.6.17 landed
- 81be0c57e290 10.12 landed
- f49e5efbc29a 11.7 landed
- b5e7569dddd2 12.2 landed
- d5b9c2baff66 13.0 landed