Skip site navigation (1) Skip section navigation (2)

Array as a parameter in user-defined functions

From: mila boldareva <pierro(at)dds(dot)nl>
To: pgsql-novice(at)postgresql(dot)org
Subject: Array as a parameter in user-defined functions
Date: 2002-02-25 13:49:31
Message-ID: 4214596338.20020225144931@dds.nl (view raw or flat)
Thread:
Lists: pgsql-novice
Hello!

I have a row in the table which is an array of floats, like, (foo float[8])

I'd like to use a function to perform some operations on that array,
access single elements of that row, like foo[1]+foo[2]. Is it possible
to pass an array to an SQL function as a parameter?

CREATE FUNCTION ADD (float[8], float[8]) RETURNS float AS ' ....

doesn't work. I might try C as well, but, again, how do I pass this float array?

Thanks,
mila
mailto:pierro(at)dds(dot)nl


Responses

pgsql-novice by date

Next:From: Pam WamplerDate: 2002-02-25 15:27:08
Subject: Tried to upgrade from 7.1.3 to 7.2 --Fatal Error
Previous:From: denisDate: 2002-02-25 13:37:49
Subject: create table with PLPGSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group