Re: Re[6]: bool_plperl transform

2020-03-07 Thread Tom Lane
=?UTF-8?B?SXZhbiBQYW5jaGVua28=?= writes: > Do you think the jsonb transform is worth explicit mentioning at the PL/Perl > documentation page, or not? Right now it's documented under the json data types, which seems sufficient to me. regards, tom lane

Re[6]: bool_plperl transform

2020-03-07 Thread Ivan Panchenko
Tom,   >Суббота, 7 марта 2020, 1:15 +03:00 от Tom Lane : >  >=?UTF-8?B?SXZhbiBQYW5jaGVua28=?= < w...@mail.ru > writes: >> [ bool_plperl_transform_v3.patch ] >I reviewed this, fixed some minor problems (mostly cosmetic, but not >entirely), and pushed it. Thanks for the commit and for your work im

Re: Re[4]: bool_plperl transform

2020-03-06 Thread Tom Lane
=?UTF-8?B?SXZhbiBQYW5jaGVua28=?= writes: > [ bool_plperl_transform_v3.patch ] I reviewed this, fixed some minor problems (mostly cosmetic, but not entirely), and pushed it. Thanks for the contribution! regards, tom lane

Re[4]: bool_plperl transform

2020-03-01 Thread Ivan Panchenko
Thanks, Tom.   I think now it should build, please find the fixed patch attached. I had no possibility to check it on Windows now, but the relevant changes in Mkvcbuild.pm are done, so I hope it should work. The documentation changes are also included in the same patch.   Regards, Ivan   >Понеде

Re[2]: bool_plperl transform

2020-03-01 Thread Ivan Panchenko
  >Понедельник, 2 марта 2020, 1:09 +03:00 от ilm...@ilmari.org: >  >Wao < w...@mail.ru > writes: >  >> +Datum >> +bool_to_plperl(PG_FUNCTION_ARGS) >> +{ >> + dTHX; >> + bool in = PG_GETARG_BOOL(0); >> + SV *sv = newSVnv(SvNV(in ? &PL_sv_yes : &PL_sv_no)); >> + return PointerGetDatum(sv); >> +}

Re: bool_plperl transform

2020-03-01 Thread Dagfinn Ilmari Mannsåker
Wao writes: > +Datum > +bool_to_plperl(PG_FUNCTION_ARGS) > +{ > + dTHX; > + bool in = PG_GETARG_BOOL(0); > + SV *sv = newSVnv(SvNV(in ? &PL_sv_yes : &PL_sv_no)); > + return PointerGetDatum(sv); > +} Why is this only copying the floating point part of the built-in booleans be

Re: Re[2]: bool_plperl transform

2020-03-01 Thread Tom Lane
=?UTF-8?B?V2Fv?= writes: > Please find the full patch attached. The cfbot shows this failing to build on Windows: https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.81889 I believe that's a build without plperl, so what it's probably telling you is that Mkvcbuild.pm needs to

Re[2]: bool_plperl transform

2020-03-01 Thread Ivan Panchenko
  >Воскресенье, 1 февраля 2020, 1:15 +03:00 от Tom Lane : >  >=?UTF-8?B?SXZhbiBQYW5jaGVua28=?= < w...@mail.ru > writes: >> While using PL/Perl I have found that it obtains boolean arguments from >> Postgres as ‘t’ and ‘f’, which is extremely inconvenient because ‘f’ is not >> false from the p

Re[2]: bool_plperl transform

2020-03-01 Thread Wao
Sorry,   Please find the full patch attached.   Ivan   >Воскресенье, 1 марта 2020, 7:57 +03:00 от Andrew Dunstan >: >  > >On 2/29/20 4:55 PM, Ivan Panchenko wrote: >> Hi, >> While using PL/Perl I have found that it obtains boolean arguments >> from Postgres as ‘t’ and ‘f’, which is extremely inc

Re: bool_plperl transform

2020-02-29 Thread Andrew Dunstan
On 2/29/20 4:55 PM, Ivan Panchenko wrote: > Hi, > While using PL/Perl I have found that it obtains boolean arguments > from Postgres as ‘t’ and ‘f’, which is extremely inconvenient because > ‘f’ is not false from the perl viewpoint. > So the problem is how to convert the SQL booleans into Perl st

Re: bool_plperl transform

2020-02-29 Thread Tom Lane
=?UTF-8?B?SXZhbiBQYW5jaGVua28=?= writes: > While using PL/Perl I have found that it obtains boolean arguments from > Postgres as ‘t’ and ‘f’, which is extremely inconvenient because ‘f’ is not > false from the perl viewpoint. > ... > * make a transform which transforms bool, like it is done wit

bool_plperl transform

2020-02-29 Thread Ivan Panchenko
Hi, While using PL/Perl I have found that it obtains boolean arguments from Postgres as ‘t’ and ‘f’, which is extremely inconvenient because ‘f’ is not false from the perl viewpoint. So the problem is how to convert the SQL booleans into Perl style.   There are 3 ways to do this: * make plperl