Re: odd behavior/possible bug - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: odd behavior/possible bug
Date
Msg-id 20030724141617.O4895-100000@megazone.bigpanda.com
Whole thread Raw
In response to Re: odd behavior/possible bug  (Joe Conway <mail@joeconway.com>)
Responses Re: odd behavior/possible bug  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
On Thu, 24 Jul 2003, Joe Conway wrote:

> Tom Lane wrote:
> > Joe Conway <mail@joeconway.com> 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 wantselect 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.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: odd behavior/possible bug
Next
From: Joe Conway
Date:
Subject: Re: odd behavior/possible bug