Re: Problems with casting

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problems with casting
Дата
Msg-id 14649.1428447019@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Problems with casting  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-general
Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
> On 4/7/15 4:35 PM, Tom Lane wrote:
>> Just out of curiosity, what's the point of this type at all, compared
>> to "anyelement" and friends?

> The two big differences are that you can store a variant in a table
> (with reasonable protection against things like dropping the underlying
> type out from under it), and you can readily determine what the original
> type was. Well, and you're not limited to a single type in a function as
> you are with polymorphic.

I'm fairly skeptical of the idea that you should want to store a variant
in a table --- smells of EAV schema design to me.  What would a unique
index mean on such a column, for instance?  As for the other two, the only
reason you can't do them with polymorphic arguments is nobody has wanted
them bad enough to do something about it.

            regards, tom lane


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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Problems with casting
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Problems with casting