Re: Problems with casting - Mailing list pgsql-general

From Tom Lane
Subject Re: Problems with casting
Date
Msg-id 14649.1428447019@sss.pgh.pa.us
Whole thread Raw
In response to Re: Problems with casting  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List 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 by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Problems with casting
Next
From: "David G. Johnston"
Date:
Subject: Re: Problems with casting