Re: Number or parameters for functions - limited to 32 ? - Mailing list pgsql-general

From Tony Caduto
Subject Re: Number or parameters for functions - limited to 32 ?
Date
Msg-id 47FBA9B4.9000708@amsoftwaredesign.com
Whole thread Raw
In response to Re: Number or parameters for functions - limited to 32 ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Just a FYI, you can get around  the 32 param limit in older versions of
postgresql by passing the function a varchar/text array, then use the
built in array functions to pull the "params" from the passed array.

Something like this(not tested code, just a sample):

CREATE or REPLACE FUNCTION test_func(varchar)
RETURNS void AS
$BODY$
DECLARE
IN_ARRAY text[] ;
ACCOUNTNUMBER_IN        varchar;
BEGIN

IN_ARRAY = string_to_array($1,'~^~');  --use a unique delimiter

ACCOUNTNUMBER_IN  = IN_ARRAY[1];

return;
END
$BODY$
LANGUAGE 'plpgsql' VOLATILE;


Later,

Tony Caduto
AM Software Design
Home of Lightning Admin for PostgreSQL and MySQL
http://www.amsoftwaredesign.com



pgsql-general by date:

Previous
From: Keaton Adams
Date:
Subject: Persistent objects within PG or the availability of non-logged tables or databases?
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Persistent objects within PG or the availability of non-logged tables or databases?