Re: Some array semantics issues - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Some array semantics issues
Date
Msg-id 10566.1132173179@sss.pgh.pa.us
Whole thread Raw
In response to Re: Some array semantics issues  (Greg Stark <gsstark@mit.edu>)
Responses Re: Some array semantics issues  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> I could go for a separate operator that has the current behavior
>> (might as well ignore number of dimensions too, if we're going to
>> ignore bounds).  Any thoughts about the operator name?

> Well to me these are two different cases. At least the way I see it {1,2} is a
> list of two numbers, and {{1,2,},{3,4}} is a list of two lists. They aren't
> the same and they don't even contain the same thing.

Well, in that case what do you think about{{1,2},{3,4},{5,6},{7,8}}
vs{{1,2,3,4},{5,6,7,8}}
These have the same physical contents and the same number of dimensions,
so unless you want to consider them equal, you have to consider the
dimension values.

I think what we may be dancing around here is that there are some cases
where it makes sense to ignore the lower bounds, as opposed to the axis
lengths.  I'm not convinced that there are any cases where it makes
sense to compare the number of dimensions without comparing the axis
lengths --- but I can see the argument that lower bounds might be
uninteresting, particularly seeing that array_push and and array_cat
do some not-necessarily-always-right things with them.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: forcing returned values to be binary
Next
From: Yann Michel
Date:
Subject: Re: PG_DUMP and table locking in PG7.4