Re: pgsql: Transforms for jsonb to PL/Perl
| От | Tom Lane |
|---|---|
| Тема | Re: pgsql: Transforms for jsonb to PL/Perl |
| Дата | |
| Msg-id | 16660.1522856736@sss.pgh.pa.us обсуждение |
| Ответ на | Re: pgsql: Transforms for jsonb to PL/Perl (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-committers |
I wrote:
> Anthony Bykov <a.bykov@postgrespro.ru> writes:
>> I guess the right test will look a little bit different:
>> CREATE FUNCTION testRegexpToJsonb() RETURNS jsonb
>> LANGUAGE plperl
>> TRANSFORM FOR TYPE jsonb
>> AS $$
>> $a = qr//;
>> return ($a);
>> $$;
> This is testing something else. I don't object to adding it,
> but we should keep the existing test in some form to verify
> that the bug stays fixed.
Huh. I put that in, and it turns out that on some Perl versions
we get a string out instead of "don't know what that is".
***************
*** 48,55 ****
return ($a);
$$;
SELECT testRegexpToJsonb();
! ERROR: cannot transform this Perl type to jsonb
! CONTEXT: PL/Perl function "testregexptojsonb"
-- this revealed a bug in the original implementation
CREATE FUNCTION testRegexpResultToJsonb() RETURNS jsonb
LANGUAGE plperl
--- 48,58 ----
return ($a);
$$;
SELECT testRegexpToJsonb();
! testregexptojsonb
! -------------------
! "(?^:foo)"
! (1 row)
!
-- this revealed a bug in the original implementation
CREATE FUNCTION testRegexpResultToJsonb() RETURNS jsonb
LANGUAGE plperl
So that's probably useful for the people it works for,
but I don't think we want a Perl-version-dependent
regression test for this. I'm inclined to just take
this test case out again.
regards, tom lane
В списке pgsql-committers по дате отправления: