Re: Range Types - typo + NULL string constructor - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Range Types - typo + NULL string constructor
Date
Msg-id 22585.1316616099@sss.pgh.pa.us
Whole thread Raw
In response to Re: Range Types - typo + NULL string constructor  (Florian Pflug <fgp@phlo.org>)
Responses Re: Range Types - typo + NULL string constructor
Re: Range Types - typo + NULL string constructor
List pgsql-hackers
Florian Pflug <fgp@phlo.org> writes:
> On Sep21, 2011, at 14:00 , Robert Haas wrote:
>> Otherwise, anyone
>> who wants to construct these strings programatically is going to need
>> to escape everything and always write ("cat","dog") or however you do
>> that, and that seems like an unnecessary imposition.

> Unless you fully depart from what arrays you, you'll have to do that anyway
> because leading and trailing spaces aren't considered to be significant in
> non-quoted elements. In other words, '( cat , dog )' represents
> textrange('cat', 'dog', '()'), *not* textrange(' cat ', ' dog ', '()').

Keep in mind that the array I/O behavior is widely considered to suck.
When we defined the record I/O behavior, we did not emulate that
whitespace weirdness, nor a number of other weirdnesses.  I would argue
that ranges ought to model their I/O behavior on records not arrays,
because that's not as much of a legacy syntax.

> Also, as long as we need to recognize at least one special value meaning
> a non-existing bound ('INF' or 'Infinity' or whatever), I don't see a way
> around the need for quotes in the general case.

Right.  In the record case, we used an empty string for NULL, and then
had to insist on quotes for actual empty strings.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Inlining comparators as a performance optimisation
Next
From: Tom Lane
Date:
Subject: Re: Inlining comparators as a performance optimisation