From: | Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> |
---|---|
To: | Ivan Panchenko <wao(at)mail(dot)ru>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: bool_plperl transform |
Date: | 2020-03-01 04:57:47 |
Message-ID: | 16cbcd48-d5cb-72a5-5447-7714caff238e@2ndQuadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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 style.
>
> There are 3 ways to do this:
>
> 1. make plperl automatically convert bools into something acceptable
> for perl. This looks simple, but probably is not acceptable as it
> breaks compatibility.
> 2. try to make some trick like it is done with arrays, i.e. convert
> bools into special Perl objects which look like ‘t’ and ‘f’ when
> treated as text, but are true and false for boolean operations. I
> am not sure that it is possible and reliable.
> 3. make a transform which transforms bool, like it is done with
> jsonb. This does not break compatibility and is rather
> straightforward.
>
> So I propose to take the third way and make such transform. This is
> very simple, a patch is attached.
> Also this patch improves the plperl documentation page, which now has
> nothing said about the transforms.
>
>
Patch appears to be missing all the new files.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Krasiyan Andreev | 2020-03-01 06:32:17 | Re: [PATCH] distinct aggregates within a window function WIP |
Previous Message | Kohei KaiGai | 2020-03-01 04:46:59 | Re: [BUG?] postgres_fdw incorrectly updates remote table if it has inherited children. |