Обсуждение: Why are json <=> jsonb casts marked as explicit-only?

Поиск
Список
Период
Сортировка

Why are json <=> jsonb casts marked as explicit-only?

От
Tom Lane
Дата:
Surely they should be assignment level, if not implicit.  I don't
really see why I should have to write a cast to assign a json
expression result into a jsonb column, in particular.
        regards, tom lane



Re: Why are json <=> jsonb casts marked as explicit-only?

От
Andrew Dunstan
Дата:
On 03/02/2015 04:26 PM, Tom Lane wrote:
> Surely they should be assignment level, if not implicit.  I don't
> really see why I should have to write a cast to assign a json
> expression result into a jsonb column, in particular.
>
>             

Probably an oversight/thinko on the part of everyone involved, me more 
than most. Possibly too an overabundance of caution.

cheers

andrew



Re: Why are json <=> jsonb casts marked as explicit-only?

От
Tom Lane
Дата:
Andrew Dunstan <andrew@dunslane.net> writes:
> On 03/02/2015 04:26 PM, Tom Lane wrote:
>> Surely they should be assignment level, if not implicit.  I don't
>> really see why I should have to write a cast to assign a json
>> expression result into a jsonb column, in particular.

> Probably an oversight/thinko on the part of everyone involved, me more 
> than most. Possibly too an overabundance of caution.

It'd be fair to be cautious about making them implicit; that could
potentially create ambiguous-function-call problems.  But I have a hard
time seeing a problem with marking them as OK for assignments.

The reason this came up is I was looking at the set of explicit casts we
have, and those two stood out like a sore thumb in terms of the semantic
similarity of the types involved.

If there are not objections, I'll go change this tomorrow or so.
        regards, tom lane