Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5Yeq-0005MC-En for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Apr 2018 15:24:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5Yep-0006pN-Da for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Apr 2018 15:24:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5Yep-0006pE-6c for pgsql-hackers@lists.postgresql.org; Mon, 09 Apr 2018 15:24:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5Yem-0007Bn-6d for pgsql-hackers@lists.postgresql.org; Mon, 09 Apr 2018 15:24:34 +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 w39FOKSc015076; Mon, 9 Apr 2018 11:24:20 -0400 From: Tom Lane To: ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) cc: Peter Eisentraut , Pavel Stehule , Nikita Glukhov , PostgreSQL Hackers Subject: Re: Transform for pl/perl In-reply-to: References: <20171127132439.23dc26ef@anthony-24-g082ur> <20171201184921.27he6vbp62yegpvm@alvherre.pgsql> <20171207125455.39067aa7@anthony-24-g082ur> <20171207125602.5326f103@anthony-24-g082ur> <20180112114739.6a9f0d4c@anthony-24-g082ur> <20180131103621.GA19345@zakirov.localdomain> <20180215125313.290468ae@anthony-24-g082ur> <20180312110821.29c80420@anthony-24-g082ur> <505345c5-0159-077d-f64e-60afb01e5fbe@postgrespro.ru> <26a0840a-6b09-44fc-9e4e-8200c1887882@2ndquadrant.com> <11284.1523282666@sss.pgh.pa.us> Comments: In-reply-to ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) message dated "Mon, 09 Apr 2018 16:02:23 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15074.1523287460.1@sss.pgh.pa.us> Date: Mon, 09 Apr 2018 11:24:20 -0400 Message-ID: <15075.1523287460@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > Tom Lane writes: >> I think you'd have to convert to text and back. That's kind of icky, >> but it beats failing. > I had a look, and that's what the PL/Python transform does. Attached is > a patch that does that for PL/Perl too, but only if the value is > actually > PG_INT64_MAX. > The secondary output files are for Perls with 32bit IV/UV types, but I > haven't been able to test them, since Debian's Perl uses 64bit integers > even on 32bit platforms. Ugh. I really don't want to maintain a separate expected-file for this, especially not if it's going to be hard to test. Can we choose another way of exercising the code path? Another issue with this code as written is that on 32-bit-UV platforms, at least some vompilers will give warnings about the constant-false predicate. Not sure about a good solution for that. Maybe it's a sufficient reason to invent uint8_numeric so we don't need a range check. regards, tom lane