Re: [GENERAL] Problems with casting

2015-04-07 Thread Tom Lane
Jim Nasby jim.na...@bluetreble.com 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

Re: [GENERAL] Problems with casting

2015-04-07 Thread Jim Nasby
On 4/7/15 4:17 PM, Tom Lane wrote: Jim Nasby jim.na...@bluetreble.com 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

[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

Re: [GENERAL] Problems with casting

2015-04-07 Thread Tom Lane
Jim Nasby jim.na...@bluetreble.com 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

Re: [GENERAL] Problems with casting

2015-04-07 Thread Jim Nasby
On 4/7/15 4:35 PM, Tom Lane wrote: Jim Nasby jim.na...@bluetreble.com 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

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 jim.na...@bluetreble.com mailto:jim.na...@bluetreble.comwrote: On 4/7/15 4:35 PM, Tom Lane wrote: Jim Nasby jim.na...@bluetreble.com writes: On 4/7/15 4:17 PM, Tom Lane wrote:

Re: [GENERAL] Problems with casting

2015-04-07 Thread Tom Lane
Jim Nasby jim.na...@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

Re: [GENERAL] Problems with casting

2015-04-07 Thread David G. Johnston
On Tue, Apr 7, 2015 at 3:09 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 4/7/15 4:35 PM, Tom Lane wrote: Jim Nasby jim.na...@bluetreble.com 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