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

From Sam Mason
Subject Re: Procedure for feature requests?
Date
Msg-id 20091003172442.GF5407@samason.me.uk
Whole thread Raw
In response to Re: Procedure for feature requests?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Procedure for feature requests?
List pgsql-general
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.

> Since that's somewhat in the eye of the beholder, we allow the user
> to adjust edge cases by creating/removing casts --- but there's no
> expectation that when you define a new datatype, you'll provide casts
> to or from unrelated types.

I know there's no expectation to create any casts.  I think what I'm
confused about is why anyone would ever bother creating any in the first
place.  I have a feeling I may have used the functionality once, but
I can't think why or for what now.  Having a function seems just as
expressive to me, which is why I think I'm missing the point.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

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