Re: [GENERAL] Problems with casting

2015-04-07 Thread Jim Nasby
On 4/7/15 5:56 PM, David G. Johnston wrote: On Tue, Apr 7, 2015 at 3:09 PM, Jim Nasby mailto:jim.na...@bluetreble.com>>wrote: On 4/7/15 4:35 PM, Tom Lane wrote: Jim Nasby writes: On 4/7/15 4:17 PM, Tom Lane wrote: I suspect that that's only the tip of

Re: [GENERAL] Problems with casting

2015-04-07 Thread David G. Johnston
On Tue, Apr 7, 2015 at 3:09 PM, Jim Nasby wrote: > On 4/7/15 4:35 PM, Tom Lane wrote: > >> Jim Nasby writes: >> >>> On 4/7/15 4:17 PM, Tom Lane wrote: >>> I suspect that that's only the tip of the iceberg. Remember the mess we had with implicit casts to text? And those only existed f

Re: [GENERAL] Problems with casting

2015-04-07 Thread Tom Lane
Jim Nasby 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 und

Re: [GENERAL] Problems with casting

2015-04-07 Thread Jim Nasby
On 4/7/15 4:35 PM, Tom Lane wrote: Jim Nasby writes: On 4/7/15 4:17 PM, Tom Lane wrote: I suspect that that's only the tip of the iceberg. Remember the mess we had with implicit casts to text? And those only existed for a dozen or so types, not for everything. Every function or operator you

Re: [GENERAL] Problems with casting

2015-04-07 Thread Tom Lane
Jim Nasby writes: > On 4/7/15 4:17 PM, Tom Lane wrote: >> I suspect that that's only the tip of the iceberg. Remember the mess >> we had with implicit casts to text? And those only existed for a dozen >> or so types, not for everything. Every function or operator you define >> for "variant" is

Re: [GENERAL] Problems with casting

2015-04-07 Thread Jim Nasby
On 4/7/15 4:17 PM, Tom Lane wrote: Jim Nasby writes: I've created a variant data type [1]. It seems to work pretty well, except for some issues with casting. Since the idea of the type is to allow storing any other data type, it creates casts to and from all other types. At first these were

Re: [GENERAL] Problems with casting

2015-04-07 Thread Tom Lane
Jim Nasby writes: > I've created a variant data type [1]. It seems to work pretty well, > except for some issues with casting. > Since the idea of the type is to allow storing any other data type, it > creates casts to and from all other types. At first these were all > marked as ASSIGNMENT, b

[GENERAL] Problems with casting

2015-04-07 Thread Jim Nasby
I've created a variant data type [1]. It seems to work pretty well, except for some issues with casting. Since the idea of the type is to allow storing any other data type, it creates casts to and from all other types. At first these were all marked as ASSIGNMENT, but that made using variant w