Re: Dynamic Array into pl/pgSQL function - Mailing list pgsql-novice

From Oliver Elphick
Subject Re: Dynamic Array into pl/pgSQL function
Date
Msg-id 1085987033.26732.1352.camel@linda
Whole thread Raw
In response to Re: Dynamic Array into pl/pgSQL function  ("derrick" <derrick@grifflink.com>)
Responses Re: Dynamic Array into pl/pgSQL function
List pgsql-novice
On Mon, 2004-05-31 at 07:24, derrick wrote:
> Okay.  I can send the numbers to the function using this array
> format:  '{123,124,125,126}'
> And the function receives those numbers in this format:  CREATE OR REPLACE
> FUNCTION public.PopContacts(varchar, int4[]).
>
> But, I still can't use the $2 or the ListOfNumbers alias in the function
> body.  I get this error:  "Unable to identify an operator '=' for
> types 'integer' and 'integer[]'  You will have to retype this query using an
> explicit cast"

...

> >   FOR rec IN SELECT caseid, name, address FROM Table1 WHERE area =
> > State and caseId In (ListOfNumbers)  LOOP

I've never needed to use it, but I think you need the operator "ANY"
rather then "IN" - see 7.4 docs section 9.17.3

--
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
     "How precious also are thy thoughts unto me, O God! how
      great is the sum of them! If I should count them, they
      are more in number than the sand; when I awake, I am
      still with thee."    Psalms 139: 17,18


pgsql-novice by date:

Previous
From: "Rajan Bhide"
Date:
Subject: Re: Error msgs from PostgreSQL server : specified item offset is too large, failed to add item to the page
Next
From: "Rajan Bhide"
Date:
Subject: Re: Error msgs from PostgreSQL server : specified item offset is too large, failed to add item to the page