Re: Transform for pl/perl

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Transform for pl/perl
Дата
Msg-id 2941.1529347229@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Transform for pl/perl  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
Ответы Re: Transform for pl/perl  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes:
> [ 0001-Fix-excess-enreferencing-in-plperl-jsonb-transform.patch ]

I tested this a bit more thoroughly by dint of applying Data::Dumper
to the Perl values, and found that we were still getting extra references
to sub-objects, for example

INFO:  $VAR1 = {'1' => \{'2' => \['3','4','5']},'2' => '3'};

where what we want is

INFO:  $VAR1 = {'1' => {'2' => ['3','4','5']},'2' => '3'};

That turns out to be because the newRV() call in JsonbValue_to_SV()
is also superfluous, if we've set up refs around HV and AV scalars.

Pushed with that change and the extra testing technology.  I'll go
push the dereferencing patch I proposed shortly, as well.

The remaining unresolved issue in this thread is Ilmari's suggestion
that we should convert integers to Perl IV (or UV?) if they fit, rather
than always convert to NV as now.  I'm inclined to reject that proposal,
though, and not just because we don't have a patch for it.  What's
bothering me about it is that then the behavior would be dependent
on the width of IV in the particular Perl installation.  I think that
is a platform dependency we can do without.

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dent John
Дата:
Сообщение: Re: Query Rewrite for Materialized Views (Postgres Extension)
Следующее
От: Jim Finnerty
Дата:
Сообщение: Re: Query Rewrite for Materialized Views (FDW Extension)