Re: tighten input to float4/float8/oid - Mailing list pgsql-patches

From Tom Lane
Subject Re: tighten input to float4/float8/oid
Date
Msg-id 21489.1078376294@sss.pgh.pa.us
Whole thread Raw
In response to Re: tighten input to float4/float8/oid  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> I think there's a case to be made that we shouldn't accept either
> leading or trailing whitespace, but it seems too late to go down that
> path: it isn't worth breaking backward compatibility over, for one thing.

To do that we'd have to use separate code for I/O and casting.  As
an example, this current behavior is unquestionably contrary to the
spec text I cited:

regression=# select '  42'::text::int;
 int4
------
   42
(1 row)

regression=# select '  42 '::text::int;
ERROR:  invalid input syntax for integer: "  42 "
regression=#

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: tighten input to float4/float8/oid
Next
From: Claudio Natoli
Date:
Subject: canonicalize_path: initdb.c -> port/path.c