Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fG8Uk-0003uR-Et for pgsql-hackers@arkaria.postgresql.org; Tue, 08 May 2018 19:41:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fG8Ui-0003QP-KM for pgsql-hackers@arkaria.postgresql.org; Tue, 08 May 2018 19:41:52 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fG8Ui-0003Q8-9g for pgsql-hackers@lists.postgresql.org; Tue, 08 May 2018 19:41:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fG8Ue-0004X6-CQ for pgsql-hackers@lists.postgresql.org; Tue, 08 May 2018 19:41:50 +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 w48JfZbd016736; Tue, 8 May 2018 15:41:35 -0400 From: Tom Lane To: Teodor Sigaev cc: Robert Haas , =?UTF-8?Q?Dagfinn_Ilmari_Manns=c3=a5ker?= , Aleksander Alekseev , David Steele , Nikita Glukhov , Darafei Praliaskouski , Anastasia Lubennikova , PostgreSQL Hackers Subject: Re: Cast jsonb to numeric, int, float, bool In-reply-to: References: <151985418868.6915.17223208131889314092.pgcf@coridan.postgresql.org> <76b000ae-94d1-cd8f-a2e0-e536096469b0@postgrespro.ru> <20180327145337.GA20311@e733.localdomain> <912e1a07-90a9-ad97-bc70-d71ec0f6f073@sigaev.ru> <0250b45d-4a38-5453-cb5a-8fa9883da36b@sigaev.ru> <20180330142119.GA1411@e733.localdomain> <20180330142423.GB1411@e733.localdomain> <24822.1525789657@sss.pgh.pa.us> <2087.1525792633@sss.pgh.pa.us> Comments: In-reply-to Teodor Sigaev message dated "Tue, 08 May 2018 18:51:59 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16734.1525808495.1@sss.pgh.pa.us> Date: Tue, 08 May 2018 15:41:35 -0400 Message-ID: <16735.1525808495@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Teodor Sigaev writes: > Thanks for your idea, patch is attached Looks mostly fine from here. A couple nitpicks: * s/translable/translatable/ * Personally I'd try harder to make the lookup table constant, that is + static const struct + { + enum jbvType type; + const char *msg; + } + messages[] = + { in hopes that it'd end up in the text segment. regards, tom lane