Re: Single-argument variant for array_length and friends?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Brendan Jurd <direvus(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Single-argument variant for array_length and friends?
Date: 2013-03-21 06:08:16
Message-ID: CAFj8pRAsM2+yPLLk5gmHpTrjVT9-Qr+Ht6ou-CnaJiP=BQHWaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2013/3/21 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Brendan Jurd <direvus(at)gmail(dot)com> writes:
>> While I was working on my empty array patch I was frequently irritated
>> by the absence of an array_length(anyarray). The same goes for
>> array_upper and array_lower. Most of the time when I work with
>> arrays, they are 1-D, and it's inelegant to having to specify which
>> dimension I mean when there is only one to choose from.
>
>> The question I have (and would appreciate your input on) is how such
>> single-argument variants should behave when operating on an array with
>> multiple dimensions?
>
> I'm not entirely convinced that this is a good idea, but if we're going
> to allow it I would argue that "array_length(a)" should be defined as
> "array_length(a, 1)". The other possibilities are too complicated to
> explain in as few words.
>

exactly

+1

Pavel

> regards, tom lane
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brendan Jurd 2013-03-21 06:13:25 Re: Single-argument variant for array_length and friends?
Previous Message Craig Ringer 2013-03-21 05:42:55 Re: Trust intermediate CA for client certificates