Re: Range Types, constructors, and the type system

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Florian Pflug <fgp(at)phlo(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Range Types, constructors, and the type system
Date: 2011-06-29 17:05:31
Message-ID: B5DE5864-6B43-4CAE-9AEE-9F5A259ED65D@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jun 29, 2011, at 8:41 AM, Jeff Davis wrote:

> We could make it a pseudo-type and make the IO functions generate
> exceptions. That should prevent most mistakes and effectively hide it
> from the user (sure, they could probably use it somewhere if they really
> want to, but I wouldn't be worried about breaking backwards
> compatibility with undocumented usage like that). There are plenty of
> types that are hidden from users in one way or another -- trigger, void,
> internal, fdw_handler, etc., so I don't see this as special-casing at
> all.

That could work.

> I don't want to go down the road of making this a fully supported type.
> I don't see any use case for it at all, and I think it's a bad idea to
> design something with no idea how people might want to use it.

+1

I'm still not clear, though, on why the return type of range() should not be related to the types of its arguments. So

range(1, 5)

Should return intrange, and

range(1::int8, 5::int8)

Should return int8range, and

range('foo', 'foooo')

Should return textrange.

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-06-29 17:07:25 Re: Re: starting to review the Extend NOT NULL representation to pg_constraint patch
Previous Message David E. Wheeler 2011-06-29 17:01:55 Re: Range Types, constructors, and the type system