pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Anthony Bykov <a.bykov@postgrespro.ru>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Transforms for jsonb to PL/Perl
Date: Wed, 04 Apr 2018 11:45:36 -0400
Message-ID: <16660.1522856736@sss.pgh.pa.us> (raw)
In-Reply-To: <30494.1522851983@sss.pgh.pa.us>
References: <E1f3MMJ-0006bf-B0@gemulon.postgresql.org>
	<13723.1522768121@sss.pgh.pa.us>
	<3001.1522769607@sss.pgh.pa.us>
	<15089.1522791424@sss.pgh.pa.us>
	<20180404161144.37d03301@anthony-24-g082ur>
	<30494.1522851983@sss.pgh.pa.us>

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




view thread (8+ messages)

Message-ID: <16660.1522856736@sss.pgh.pa.us>
Permalink:  ../16660.1522856736@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16660.1522856736@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, a.bykov@postgrespro.ru, peter_e@gmx.net
  Subject: Re: pgsql: Transforms for jsonb to PL/Perl
  In-Reply-To: <16660.1522856736@sss.pgh.pa.us>
  References: <E1f3MMJ-0006bf-B0@gemulon.postgresql.org> <13723.1522768121@sss.pgh.pa.us> <3001.1522769607@sss.pgh.pa.us> <15089.1522791424@sss.pgh.pa.us> <20180404161144.37d03301@anthony-24-g082ur> <30494.1522851983@sss.pgh.pa.us> <16660.1522856736@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox