Re: Procedure for feature requests? - Mailing list pgsql-general

From Tom Lane
Subject Re: Procedure for feature requests?
Date
Msg-id 8524.1254600861@sss.pgh.pa.us
Whole thread Raw
In response to Re: Procedure for feature requests?  (Sam Mason <sam@samason.me.uk>)
Responses Re: Procedure for feature requests?
List pgsql-general
Sam Mason <sam@samason.me.uk> writes:
> On Sat, Oct 03, 2009 at 12:48:57PM -0400, Tom Lane wrote:
>> I think the reason CREATE CAST exists is exactly that the cast mechanism
>> *isn't* intended to provide conversions between any arbitrary pair of
>> datatypes.  It's only intended to provide conversions in those cases
>> where the conversion semantics are obvious to some degree or other.

> Yup, but the decision to officially bless some code as being a cast
> rather than "just" a function seems very arbitrary, I think this is why
> I don't understand its purpose.

It's useful when the conversion semantics are sufficiently natural that
you want the conversion to be applied implicitly.  I agree that the
explicit CAST syntax hasn't got very much to recommend it over a
function call.  That part you can blame on the SQL committee ;-) ...
the historical PostQUEL syntax for this was exactly a function call,
and you can still write it that way if you choose.

            regards, tom lane

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: Embarassing GROUP question
Next
From: Tom Lane
Date:
Subject: Re: Embarassing GROUP question