Re: Allowing implicit 'text' -> xml|json|jsonb (was: PL/pgSQL 2)

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Allowing implicit 'text' -> xml|json|jsonb (was: PL/pgSQL 2)
Дата
Msg-id CAHyXU0yFjaAga1awQgbAEzLHLveC3TUMcEf1Fht=WVhscjFynQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Allowing implicit 'text' -> xml|json|jsonb (was: PL/pgSQL 2)  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
On Fri, Sep 5, 2014 at 2:04 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
> On 09/05/2014 12:04 AM, Pavel Stehule wrote:
>>
>> But some missing casts are well - I found lot performance issues based
>> on using wrong data types - integers, dates in text column.
>
> Of course! That's why the default implicit casts were removed, and for
> good reason. I'm only talking about a narrow class of a few specific types.
>
> I think maybe a _few_ types need to be implicitly convertable from text,
> but that's about it.
>
> text -> jsonb
> text -> json
> text -> xml
> text -> hstore
> text -> uuid
> text -> (user defined enum)
>
> ... mainly because otherwise app devs need frustrating workarounds (or
> giving up on the PostgreSQL native types and just using 'text' columns),
> and because in all these cases PostgreSQL will validate the input.

That seems pretty reasonable.  If you do that along with redefining
certain functions like lpad() to take "any" instead of text you'd
eliminate most of the headaches.

merlin



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: VIP: explain of running query
Следующее
От: Oskari Saarenmaa
Дата:
Сообщение: [PATCH] parser: optionally warn about missing AS for column and table aliases