Skip site navigation (1) Skip section navigation (2)

Re: Range Types, constructors, and the type system

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Range Types, constructors, and the type system
Date: 2011-06-29 17:11:52
Message-ID: 55DA0626-7369-491A-AAD9-0CC5903E4680@phlo.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Jun29, 2011, at 18:34 , Robert Haas wrote:
> It also seems a bit strange to me that we're contemplating a system
> where users are always going to have to cast the return type.
> Generally, casts are annoying and we want to minimize the need for
> them.  I'm not sure what the alternative is, though, unless we create
> separate constructor functions for each type: int8range_cc(1, 2).

Well, if we want multiple range types per base type (which we do), then
the user needs to specify which one to use somehow. A cast seems the most
natural way to do that to me - after all, casting is *the* way to coerce
value to a certain type.

best regards,
Florian Pflug


In response to

pgsql-hackers by date

Next:From: Florian PflugDate: 2011-06-29 17:13:55
Subject: Re: Range Types, constructors, and the type system
Previous:From: Robert HaasDate: 2011-06-29 17:07:25
Subject: Re: Re: starting to review the Extend NOT NULL representation to pg_constraint patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group