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

From Florian Pflug
Subject Re: Range Types, constructors, and the type system
Date
Msg-id 1FE22405-4DBA-408A-A785-31C405F36F54@phlo.org
Whole thread Raw
In response to Re: Range Types, constructors, and the type system  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Jul5, 2011, at 17:11 , Jeff Davis wrote:
> I'm OK with the intermediate type, but Florian seems skeptical of that
> idea.

I'm starting to get used to it, though ;-) I do now believe that it can
be made safe against accidental miss-use, it seem that I was overly
anxious there.

What I still don't like about it is that it feels like a workaround for
a feature missing in our type system - the possibility of having function
with a polymorphic return type, but no polymorphic arguments. I feel
somewhat strongly about this, because it bit me when I tried to implement
record_getfield() and record_setfield() to get and set a record's field
based on it's name.

However, placing the burden of solving that onto the range type patch
doesn't seem fair.

Plus, I've realized now that a RANGEINPUT type would allow us to easily
support some things that otherwise seem hard. We could, for example,
make the cast from RANGEINPUT to the individual range types an assignment
cast (or even implicit), thereby removing the need for an explicit
cast in a lot of common cases like insert into a table with a range column.

best regards,
Florian Pflug



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [BUGS] COPY .... WITH (FORMAT binary) causes syntax error at or near "binary"
Next
From: Robert Haas
Date:
Subject: capturing regression test core dump