Re: [HACKERS] Custom aggragation function that creates an array

2010-10-23 Thread Leonardo Francalanci
Before you start coding, have you looked over what's in contrib/intarray ? There's nothing that fulfills my needs there, but I guess it would be the perfect place to watch for code examples! Thank you (I think I made my custom aggregation function work, but I'll look into intarray code to

[HACKERS] Custom aggragation function that creates an array

2010-10-22 Thread Leonardo Francalanci
Hi, I want to write a custom agg function that, given an int4 index, increments the element at index of an array and, at the end, returns the array. The array will always be int4[]. I need it in C, since plpgsql is way slower (and I need to use it in 5M+ rows). I did it, but I also need to

Re: [HACKERS] Custom aggragation function that creates an array

2010-10-22 Thread David Fetter
On Fri, Oct 22, 2010 at 02:02:48PM +0100, Leonardo Francalanci wrote: Hi, I want to write a custom agg function that, given an int4 index, increments the element at index of an array and, at the end, returns the array. The array will always be int4[]. Before you start coding, have you