White space affecting parsing of range values - Mailing list pgsql-general

From Thom Brown
Subject White space affecting parsing of range values
Date
Msg-id CAA-aLv7oUgi6RGJetZwuvoVz=wdcZBmWkY3wMOyW2fGVpN+ybQ@mail.gmail.com
Whole thread Raw
Responses Re: White space affecting parsing of range values  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Hi,

I noticed I'm getting an error when adding white space to a numeric
range.  I can run this:

postgres=# SELECT 5::numeric <@ '(,10]'::numrange;
 ?column?
----------
 t
(1 row)

But I can't run this:

postgres=# SELECT 5::numeric <@ '(  ,10]'::numrange;
ERROR:  invalid input syntax for type numeric: "  "
LINE 1: SELECT 5::numeric <@ '(  ,10]'::numrange;
                             ^
If one had constructed a series of ranges, and wanted to line them up
vertically for easy comprehension, this wouldn't be possible.

This doesn't seem to be a problem with regular numeric values:

postgres=# SELECT ' 3 '::numeric;
 numeric
---------
       3
(1 row)


Shouldn't white space be ignored in range values?

-- 
Thom



pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Lock Postgres account after X number of failed logins?
Next
From: Jasen Lentz
Date:
Subject: RE: pg_basebackup inconsistent performance