On Thu, 24 Jul 2003, Joe Conway wrote: > Tom Lane wrote: > > Joe Conway <[EMAIL PROTECTED]> writes: > >>So far so good. But look at this one: > >>regression=# select dwarray(null,null); > >>ERROR: cannot determine ANYARRAY/ANYELEMENT type because input is UNKNOWN > > > > That seems correct to me. What would you expect to happen? There's no > > type we could assign as the function's actual return type. > > 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? 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. ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly