From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Sam Mason <sam(at)samason(dot)me(dot)uk> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Procedure for feature requests? |
Date: | 2009-10-03 20:14:21 |
Message-ID: | 8524.1254600861@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Sam Mason <sam(at)samason(dot)me(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2009-10-03 20:39:40 | Re: Embarassing GROUP question |
Previous Message | Sam Mason | 2009-10-03 17:31:26 | Re: Embarassing GROUP question |