Re: Single-argument variant for array_length and friends?

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Brendan Jurd <direvus(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Single-argument variant for array_length and friends?
Date: 2013-03-21 22:12:24
Message-ID: CAHyXU0x91V+wxDiWMwfnoxeMfT3oHZ3H3rHZuEOMm05q86sCcw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 21, 2013 at 2:00 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> 2013/3/21 Brendan Jurd <direvus(at)gmail(dot)com>:
>> On 21 March 2013 17:32, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>>> If I though about it more, I like to more limit one parametric
>>> array_length function just for only 1D array. So it is your A use
>>> case. But I understand so this variant is not orthogonal. Hard to say,
>>> what is better.
>>>
>>
>> Yes, for me (a) is running a very close 2nd place to (c). The
>> strength of (a) is it means we aren't making guesses about the user's
>> intention. When a user concocts an expression that is ambiguous, I
>> feel it is usually good to kick it back to them and ask them to be
>> more precise.
>>
>> On the other hand, I find it very natural to interpret "what is the
>> length of my multidim array" to mean "what is the length of the
>> outermost dimension of my multidim array", because to me a multidim
>> array is just an array that contains more arrays.
>
> lot of postgresql functions calculate with all items in array without
> respect to dimensions - like unnest.
>
> so concept "use outermost dim" is not in pg now, and should not be
> introduced if it is possible. More it goes against a verbosity concept
> introduced by ADA and reused in PL/SQL and PL/pgSQL.

and pl/psm*

merlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2013-03-21 22:12:45 Re: SIGHUP not received by custom bgworkers if postmaster is notified
Previous Message Dimitri Fontaine 2013-03-21 20:27:25 Re: [COMMITTERS] pgsql: Fix "element <@ range" cost estimation.