Re: How to hand over array as variable in plpgsql function? - Mailing list pgsql-sql

From Tom Lane
Subject Re: How to hand over array as variable in plpgsql function?
Date
Msg-id 23347.1225136790@sss.pgh.pa.us
Whole thread Raw
In response to How to hand over array as variable in plpgsql function?  ("Jan Peters" <petersjan@gmx.at>)
Responses Re: How to hand over array as variable in plpgsql function?  ("Jan Peters" <petersjan@gmx.at>)
List pgsql-sql
"Jan Peters" <petersjan@gmx.at> writes:
> ERROR: operator is not unique: "unknown" || real[]

> EXECUTE 'SELECT id FROM precip_arrays WHERE  '||b||' = precip_control;' INTO id_result;

Seems like using EXECUTE is the hardest possible way to do this.  Why
don't you just SELECT?

SELECT id FROM precip_arrays WHERE b = precip_control INTO id_result;

If you insist on using EXECUTE then you're going to have to fool with
converting the array to an appropriate text representation.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Osvaldo Kussama"
Date:
Subject: Fwd: grouping/clustering query
Next
From: "Jan Peters"
Date:
Subject: Re: How to hand over array as variable in plpgsql function?