Re: How to hand over array as variable in plpgsql function?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jan Peters" <petersjan(at)gmx(dot)at>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to hand over array as variable in plpgsql function?
Date: 2008-10-27 19:46:30
Message-ID: 23347.1225136790@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Jan Peters" <petersjan(at)gmx(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Peters 2008-10-28 08:23:40 Re: How to hand over array as variable in plpgsql function?
Previous Message Osvaldo Kussama 2008-10-27 19:28:09 Fwd: grouping/clustering query