Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL) - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Date
Msg-id CADxJZo3bSfweXaOaYREUGqy9w_easG_2q10kFL9F+mm+=jqhQQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 8 April 2013 16:09, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Brendan Jurd <direvus@gmail.com> writes:
>> On the specific issue of CARDINALITY, I guess we need to decide
>> whether we are going to pretend that our array/matrix thing is
>> actually nested.  I first argued that we should not.   But it occurred
>> to me that if we do pretend, it would at least leave the door ajar if
>> we want to do something to make our arrays more nest-like in future,
>> without disrupting the behaviour of CARDINALITY.
>
> This seems to be exactly the same uncertainty that we couldn't resolve
> back in the 8.4 devel cycle, for exactly the same reasons.  I don't see
> that the discussion has moved forward any :-(
>

I had a poke around in the archives, and it seems to me that the major
argument that was advanced in favour of making cardinality() return
the total number of items was ... we don't have anything that does
that yet.  That's why I'm proposing we add array_num_items as well --
I do think there should be a function for this, I just don't think
cardinality fits the bill.

Cheers,
BJ



pgsql-hackers by date:

Previous
From: Rodrigo Barboza
Date:
Subject: Re: Unrecognized type error (postgres 9.1.4)
Next
From: Tom Lane
Date:
Subject: Re: Unrecognized type error (postgres 9.1.4)