Re: Range Types - typo + NULL string constructor

From: David Fetter <david(at)fetter(dot)org>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Florian Pflug <fgp(at)phlo(dot)org>, Thom Brown <thom(at)linux(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Range Types - typo + NULL string constructor
Date: 2011-10-11 12:43:07
Message-ID: 20111011124307.GD19845@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 10, 2011 at 10:25:18PM -0700, Jeff Davis wrote:
> On Tue, 2011-10-11 at 03:14 +0200, Florian Pflug wrote:
> > Maybe ranges over discrete types are slightly more likely to be
> > closed, and ranges over continuous types slightly more likely to
> > be open. Still, I very much doubt that the skew in the
> > distribution is large enough to warrant the confusion and
> > possibility of subtle bugs we introduce by making the semantics of
> > a range type's constructor depend on the definition of the range
> > and/or base type.
>
> I think you persuaded me on the consistency aspect.
>
> I'm wondering whether to do away with the default argument entirely,
> and just force the user to always specify it during construction. It
> seems like a shame that such pain is caused over the syntax, because
> in a perfect world it wouldn't be a bother to specify it at all. I
> even considered using prefix/postfix operators to try to make it
> nicer, but it seems like every idea I had was just short of
> practical. Maybe a few extra characters at the end aren't so bad.
>
> I'd like to hear from some potential users though to see if anyone
> recoils at the common case.

I'd recoil at not having ranges default to left-closed, right-open.
The use case for that one is so compelling that I'm OK with making it
the default from which deviations need to be specified.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2011-10-11 12:45:14 Re: Proposal: casts row to array and array to row
Previous Message Royce Ausburn 2011-10-11 12:40:51 Re: [REVIEW] Patch for cursor calling with named parameters