Re: Range Types, constructors, and the type system - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: Range Types, constructors, and the type system
Date
Msg-id B5DE5864-6B43-4CAE-9AEE-9F5A259ED65D@kineticode.com
Whole thread Raw
In response to Re: Range Types, constructors, and the type system  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Range Types, constructors, and the type system
List 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

pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Range Types, constructors, and the type system
Next
From: Robert Haas
Date:
Subject: Re: Re: starting to review the Extend NOT NULL representation to pg_constraint patch