pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ilmari@ilmari.org
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Nikita Glukhov <n.gluhov@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Transform for pl/perl
Date: Mon, 18 Jun 2018 17:48:05 -0400
Message-ID: <29396.1529358485@sss.pgh.pa.us> (raw)
In-Reply-To: <2941.1529347229@sss.pgh.pa.us>
References: <20180606161453.tvp4ltavlcvejmmz@alvherre.pgsql>
	<e5130c85-23da-5d11-ca74-6a050cc5fa85@2ndquadrant.com>
	<d8jlgbq66t9.fsf@dalvik.ping.uio.no>
	<2941.1529347229@sss.pgh.pa.us>

I wrote:
> 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.

Oh ... after re-reading the thread I realized there was one other point
that we'd all forgotten about, namely the business about ~0 getting
converted to -1 rather than what Perl interprets it as.  Ilmari sent in
a patch for that, against which I'd raised two complaints:

1. Possible compiler complaints about a constant-false comparison,
on machines where type UV is 32 bits.

2. Need for secondary expected-output files, which'd be a pain to
maintain.

I realized that point 1 could be dealt with just by not trying to be
smart, but always using the convert-to-text code path.  Given that it
seems to be hard to produce a UV value in Perl, I doubt it is worth
working any harder than that.  Also, point 2 could be dealt with in
this perhaps crude way:

-- this might produce either 18446744073709551615 or 4294967295
SELECT testUVToJsonb() IN ('18446744073709551615'::jsonb, '4294967295'::jsonb);

Pushed with those adjustments.

			regards, tom lane




view thread (62+ messages)

Message-ID: <29396.1529358485@sss.pgh.pa.us>
Permalink:  ../29396.1529358485@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29396.1529358485@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ilmari@ilmari.org, peter.eisentraut@2ndquadrant.com, alvherre@2ndquadrant.com, pavel.stehule@gmail.com, n.gluhov@postgrespro.ru, pgsql-hackers@lists.postgresql.org
  Subject: Re: Transform for pl/perl
  In-Reply-To: <29396.1529358485@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