deferencing array of int8

From: Christopher Yap <cyap(at)linmor(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: deferencing array of int8
Date: 2001-07-16 22:03:55
Message-ID: EXECMAIL.1010716170355.D8272@lmeride9.linmor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've done some searching through the mailing lists and haven't found
any info regarding what I need.

I have an array of values of type int8.
I want to be able to rollup the data and have postgres do all the
summing for me. I've looked at the commands and haven't found what I
need.

Here is what I get:
detailed=# select sum(valuearray) from data where objid=34;
ERROR: Unable to select an aggregate function sum(_int8)

So I decided I would write my own function that I would load into
postgres.
The problem is, how do I access each element in the array?
I can get the array and return it, but in the function I would like to
get each separate value and do the summing, then return the summed
array.

Can anyone help?

Thanks,
Chris

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Pilosov 2001-07-16 22:16:26 Re: pg_depend
Previous Message Bruce Momjian 2001-07-16 21:18:13 Re: ALTER TABLE ADD COLUMN column SERIAL -- unexpected results