Re: Procedure for feature requests?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Procedure for feature requests?
Дата
Msg-id 8524.1254600861@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Procedure for feature requests?  (Sam Mason <sam@samason.me.uk>)
Ответы Re: Procedure for feature requests?
Список 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 по дате отправления:

Предыдущее
От: Sam Mason
Дата:
Сообщение: Re: Embarassing GROUP question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Embarassing GROUP question