Re: odd behavior/possible bug
От | Joe Conway |
---|---|
Тема | Re: odd behavior/possible bug |
Дата | |
Msg-id | 3F205289.1050702@joeconway.com обсуждение исходный текст |
Ответ на | Re: odd behavior/possible bug (Stephan Szabo <sszabo@megazone.bigpanda.com>) |
Список | pgsql-hackers |
Stephan Szabo wrote: > On Thu, 24 Jul 2003, Joe Conway wrote: >>I see your point, but mine was that in this case I'd like a NULL >>returned and I don't really care about the type. ISTM that NULL should >>be able to morph into any type it needs to. > > I don't think that's necessarily true. > As a potentially absurd example, do we want > select CAST( CAST( NULL as DATE ) as POINT ); > to succeed when dates aren't convertable to points? good point -- no pun intended ;) > > The case of func(anyelement, anyelement) returns anyarray could > potentially return some kind of "array of unknown (but single) type" > when presented with unknown inputs. I'm not sure what use that'd be > unless you are allowed to convert it into something else, though. > Hmm, this sounds like yet another reason for UNKNOWN[]. Specifically what I wanted to do was create a function that would give me a NULL if any arguments to my ARRAY[] expression were NULL. But the change Tom suggested (i.e. ARRAY[NULL,...] evaluates to NULL) gives me that without needing the function, so probably that is the best answer. Joe
В списке pgsql-hackers по дате отправления: