Re[2]: bool_plperl transform

Ivan Panchenko <wao@mail.ru>

From: Ivan Panchenko <wao@mail.ru>
To: ilmari@ilmari.org
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, pgsql-hackers@lists.postgresql.org
Date: 2020-03-01T23:30:46Z
Lists: pgsql-hackers


  
>Понедельник, 2 марта 2020, 1:09 +03:00 от ilmari@ilmari.org:
> 
>Wao < wao@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);
>> +}
>Why is this only copying the floating point part of the built-in
>booleans before returning them? I think this should just return
>&PL_sv_yes or &PL_sv_no directly, like boolean expressions in Perl do,
>and like what happens for NULL (&PL_sv_undef).
Thanks, I will fix this in the next version of the patch.
 
Regards,
Ivan
>
>- ilmari
>--
>"A disappointingly low fraction of the human race is,
> at any given time, on fire." - Stig Sandbeck Mathisen
>
>  
 
 
 
 

Commits

  1. Create contrib/bool_plperl to provide a bool transform for PL/Perl[U].