Re: Transform for pl/perl
Anthony Bykov <a.bykov@postgrespro.ru>
From: Anthony Bykov <a.bykov@postgrespro.ru>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2018-01-12T08:47:39Z
Lists: pgsql-hackers
Attachments
- 0001-jsonb_plperl-extension-v6.patch (text/x-patch) patch v6-0001
On Fri, 12 Jan 2018 15:19:26 +1300
Thomas Munro <thomas.munro@enterprisedb.com> wrote:
> On Thu, Dec 7, 2017 at 10:56 PM, Anthony Bykov
> <a.bykov@postgrespro.ru> wrote:
> >> Please, find a new version of the patch in attachments to this
> >> message.
>
> Hi again Anthony,
>
> I wonder why make check passes for me on my Mac, but when Travis CI
> (Ubuntu Trusty on amd64) runs it, it fails like this:
>
> test jsonb_plperl ... FAILED
> test jsonb_plperl_relocatability ... ok
> test jsonb_plperlu ... FAILED
> test jsonb_plperlu_relocatability ... ok
>
> ========= Contents of ./contrib/jsonb_plperl/regression.diffs
> *** /home/travis/build/postgresql-cfbot/postgresql/contrib/jsonb_plperl/expected/jsonb_plperl.out
> 2018-01-11 21:46:35.867584467 +0000
> --- /home/travis/build/postgresql-cfbot/postgresql/contrib/jsonb_plperl/results/jsonb_plperl.out
> 2018-01-11 21:55:08.564204175 +0000
> ***************
> *** 89,96 ****
> (1 row)
>
> SELECT testSVToJsonb2('1E+131071');
> ! ERROR: could not transform to type "jsonb"
> ! DETAIL: The type you are trying to transform can't be transformed
> to jsonb CONTEXT: PL/Perl function "testsvtojsonb2"
> SELECT testSVToJsonb2('-1');
> testsvtojsonb2
> --- 89,95 ----
> (1 row)
>
> SELECT testSVToJsonb2('1E+131071');
> ! ERROR: invalid input syntax for type numeric: "inf"
> CONTEXT: PL/Perl function "testsvtojsonb2"
> SELECT testSVToJsonb2('-1');
> testsvtojsonb2
> ======================================================================
> *** /home/travis/build/postgresql-cfbot/postgresql/contrib/jsonb_plperl/expected/jsonb_plperlu.out
> 2018-01-11 21:46:35.867584467 +0000
> --- /home/travis/build/postgresql-cfbot/postgresql/contrib/jsonb_plperl/results/jsonb_plperlu.out
> 2018-01-11 21:55:08.704204228 +0000
> ***************
> *** 89,96 ****
> (1 row)
>
> SELECT testSVToJsonb2('1E+131071');
> ! ERROR: could not transform to type "jsonb"
> ! DETAIL: The type you are trying to transform can't be transformed
> to jsonb CONTEXT: PL/Perl function "testsvtojsonb2"
> SELECT testSVToJsonb2('-1');
> testsvtojsonb2
> --- 89,95 ----
> (1 row)
>
> SELECT testSVToJsonb2('1E+131071');
> ! ERROR: invalid input syntax for type numeric: "inf"
> CONTEXT: PL/Perl function "testsvtojsonb2"
> SELECT testSVToJsonb2('-1');
> testsvtojsonb2
> ======================================================================
>
Hello, thank you for your message.
The problem was that different perl compilers uses different infinity
representations. Some of them use "Inf" others - use "inf". So, in
attachments there is a new version of the patch.
Thank you again.
--
Anthony Bykov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Commits
-
Fix jsonb_plperl to convert Perl UV values correctly.
- 93b6e03ab479 11.0 landed
-
Fix contrib/hstore_plperl to look through scalar refs.
- e3b7f7cc5063 11.0 landed
- 7594b7a53366 10.5 landed
- 645929c545ef 9.5.14 landed
- 1bebfb9b6365 9.6.10 landed
-
Allow plperl_sv_to_datum to look through scalar refs.
- 3a382983d142 11.0 landed
-
Fix excessive enreferencing in jsonb-to-plperl transform.
- 1731e3741cbb 11.0 landed