Re: Allowing implicit 'text' -> xml|json|jsonb

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Allowing implicit 'text' -> xml|json|jsonb
Дата
Msg-id 54097D74.1050501@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Allowing implicit 'text' -> xml|json|jsonb  (Marko Tiikkaja <marko@joh.to>)
Ответы Re: Allowing implicit 'text' -> xml|json|jsonb  (Marko Tiikkaja <marko@joh.to>)
Re: Allowing implicit 'text' -> xml|json|jsonb  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 09/05/2014 05:04 PM, Marko Tiikkaja wrote:
> 
> I really don't like the idea of relaxing casts.  And I really object to
> the notion of casting from test to date being "obviously right".

Gah. It's obviously right to *reject* implicit conversions like
text->date. I specifically do _not_ want to add such a conversion, and
gave a list of types for which I think conversions from text are
appropriate.

> The problem here seems to be only related to mistyped parameters.  Can
> we contain the damage to that part only somehow?  Or make this optional
> (defaulting to off, I hope)?

I'd love to make it affect only parameters, actually, for v3 protocol
bind/parse/execute. That would be ideal.

Right now the main workaround is to send all string-typed parameters as
'unknown'-typed, but that causes a mess with function overload
resolution, and it's wrong most of the time when the parameter really is
just text.


-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Marko Tiikkaja
Дата:
Сообщение: Re: Allowing implicit 'text' -> xml|json|jsonb
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal: plpgsql - Assert statement