Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijTyT-0005ll-Ms for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Dec 2019 20:06:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ijTyR-0002Xd-4j for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Dec 2019 20:06:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijTyQ-0002XW-LF for pgsql-bugs@lists.postgresql.org; Mon, 23 Dec 2019 20:06:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ijTyO-0004Hb-3I for pgsql-bugs@lists.postgresql.org; Mon, 23 Dec 2019 20:06:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBNK6WBs024799; Mon, 23 Dec 2019 15:06:32 -0500 From: Tom Lane To: Joe Conway cc: ipluta@wp.pl, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16176: NULL value returned by category_sql argument to crosstab() causes segmentation fault In-reply-to: <5103290c-be78-bb9c-eef2-eeeecee0bf23@joeconway.com> References: <16176-7489719b05e4303c@postgresql.org> <8638.1576864859@sss.pgh.pa.us> <8d8ef71e-a347-67be-696a-3bdd259ec9fb@joeconway.com> <12400.1576940917@sss.pgh.pa.us> <208f13a0-0433-6780-802d-fedcff3c8991@joeconway.com> <19151.1577126972@sss.pgh.pa.us> <5103290c-be78-bb9c-eef2-eeeecee0bf23@joeconway.com> Comments: In-reply-to Joe Conway message dated "Mon, 23 Dec 2019 14:00:38 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24797.1577131592.1@sss.pgh.pa.us> Date: Mon, 23 Dec 2019 15:06:32 -0500 Message-ID: <24798.1577131592@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Joe Conway 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