Greg Stark <[EMAIL PROTECTED]> writes:
> array_lower() and array_upper() are returning NULL for a non-null
> input, the empty array, even though lower and upper bounds are known
> just as well as they are for any other sized array. They are behaving
> as if there's something unknown about the empty array that makes it
> hard to provide a lower bound or upper bound.

Hm.  My idea of the index lower bound is "the smallest index for which
there is an array member" --- so I agree with Joe that it's not very
well defined for an empty array.  We could pick some arbitrary value,
such as zero, for the LB and UB to be reported for an empty array, but
I can't see any way that you could justify them except as arbitrary
choices.

I think that maybe we ought to question these two properties:
        * empty array is different from NULL ... really?  Why?
        * storing a value into an element of a NULL array yields
          a NULL array instead of a singleton array.
IIRC the latter is presently true because we couldn't figure out
just what dimensionality to assign, but it might be easier to agree on
that than to resolve these other arguments...

                        regards, tom lane

---------------------------(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

Reply via email to