Re: [HACKERS] Single-argument variant for array_length and friends?

2013-03-23 Thread Brendan Jurd
On 22 March 2013 09:12, Merlin Moncure mmonc...@gmail.com wrote: On Thu, Mar 21, 2013 at 2:00 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 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

Re: [HACKERS] Single-argument variant for array_length and friends?

2013-03-21 Thread Pavel Stehule
2013/3/21 Tom Lane t...@sss.pgh.pa.us: Brendan Jurd dire...@gmail.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

Re: [HACKERS] Single-argument variant for array_length and friends?

2013-03-21 Thread Brendan Jurd
On 21 March 2013 17:08, Pavel Stehule pavel.steh...@gmail.com wrote: 2013/3/21 Tom Lane t...@sss.pgh.pa.us: 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

Re: [HACKERS] Single-argument variant for array_length and friends?

2013-03-21 Thread Pavel Stehule
2013/3/21 Brendan Jurd dire...@gmail.com: On 21 March 2013 17:08, Pavel Stehule pavel.steh...@gmail.com wrote: 2013/3/21 Tom Lane t...@sss.pgh.pa.us: 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

Re: [HACKERS] Single-argument variant for array_length and friends?

2013-03-21 Thread Brendan Jurd
On 21 March 2013 17:32, Pavel Stehule pavel.steh...@gmail.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,

Re: [HACKERS] Single-argument variant for array_length and friends?

2013-03-21 Thread Pavel Stehule
2013/3/21 Brendan Jurd dire...@gmail.com: On 21 March 2013 17:32, Pavel Stehule pavel.steh...@gmail.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

Re: [HACKERS] Single-argument variant for array_length and friends?

2013-03-21 Thread Merlin Moncure
On Thu, Mar 21, 2013 at 2:00 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 2013/3/21 Brendan Jurd dire...@gmail.com: On 21 March 2013 17:32, Pavel Stehule pavel.steh...@gmail.com wrote: If I though about it more, I like to more limit one parametric array_length function just for only 1D

Re: [HACKERS] Single-argument variant for array_length and friends?

2013-03-20 Thread Tom Lane
Brendan Jurd dire...@gmail.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