From advid@newgen.co.in Thu Oct 4 03:47:50 2001 Received: from nhweb.newgen.co.in ([202.89.64.23]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f943lnn85184 for ; Wed, 3 Oct 2001 23:47:50 -0400 (EDT) (envelope-from advid@newgen.co.in) Received: from advid (ws103.newgen.co.in [192.168.5.103]) by nhweb.newgen.co.in (8.9.3/8.9.3/Debian 8.9.3-21) with SMTP id OAA19256 for ; Thu, 4 Oct 2001 14:54:22 +0530 X-Authentication-Warning: nhweb.newgen.co.in: Host ws103.newgen.co.in [192.168.5.103] claimed to be advid Message-ID: <002301c14c87$5104ce90$6705a8c0@advid> From: "Advid@newgen" To: Subject: maximum parameters limit to function & manipulating array in plpgsql Date: Thu, 4 Oct 2001 09:17:40 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0020_01C14CB5.6A953740" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Archive-Number: 200110/44 X-Sequence-Number: 4999 This is a multi-part message in MIME format. ------=_NextPart_000_0020_01C14CB5.6A953740 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I have 2 major problems bothering me and probably u are the best person to = help me out :- 1)=20 Well I read one of ur solutions to sending more tham 16 parameters to a fun= ction in plpgsql. I have changed the value of FUNC_MAX_ARGS (a/k/a INDEX_MA= X_KEYS) in \usr\local\plpgsql\include\config.h after stoping the postmaster= service. On restarting the service after having changed config.h I am atill experie= ncing the same problem. What should I do now? 2)=20 Secondly I am trying to use arrays as below : create function ftest(integer[]) returns integer[] as' declare n $1%type; begin . ... n:=3D{1,12,11}; return n; end; 'language 'plpgsql'; If I declare n as integer[3] it gives a compilation error. So I tried it as= above. Can I do any array manipulations at all in plpgsql like assigning,c= opying etc values in to other arrays in plpgsql. If so how ?? =20 Do help me out since I have got stuck with both these problems. Regards, Advid=20 Newgen Software Tech ------=_NextPart_000_0020_01C14CB5.6A953740 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have 2 major problems bothering me and p= robably u=20 are the best person to help me out :-
 
1)
Well I read one of ur solutions to sending= more=20 tham 16 parameters to a function in plpgsql. I have changed the value of=20 FUNC_MAX_ARGS (a/k/a INDEX_MAX_KEYS) in=20 \usr\local\plpgsql\include\config.h after= =20 stoping the postmaster service.
 On restarting the service after havi= ng=20 changed config.h I am atill experiencing the same problem. What should I do= =20 now?
 
2)
Secondly I am trying to use arrays as belo= w=20 :
 
create function ftest(integer[]) returns intege= r[]=20 as'
declare
n=20 $1%type;
begin
    .
    ...
    n:=3D{1,12,11};
 &nb= sp; =20 return n;
end;
'language 'plpgsql';
 
If I declare n as integer[3] it gives a co= mpilation=20 error. So I tried it as above. Can I do any array manipulations at all in= =20 plpgsql like assigning,copying etc values in to other arrays in plpgsql. If= so=20 how ??
 
Do help me out since I have got = stuck=20 with both these problems.
 
Regards,
Advid 
Newgen Software Tech
------=_NextPart_000_0020_01C14CB5.6A953740-- From josh@agliodbs.com Thu Oct 4 14:51:52 2001 Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f94Eppn05058 for ; Thu, 4 Oct 2001 10:51:52 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 141632; Thu, 04 Oct 2001 07:51:46 -0700 From: "Josh Berkus" Subject: Re: maximum parameters limit to function & manipulating array in plpgsql To: "Advid@newgen" , X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Thu, 04 Oct 2001 07:51:46 -0700 Message-ID: In-Reply-To: <002301c14c87$5104ce90$6705a8c0@advid> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_===141632====davinci.ethosmedia.com===_" X-Archive-Number: 200110/50 X-Sequence-Number: 5005 This is a multi-part MIME message --_===141632====davinci.ethosmedia.com===_ Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Advid, > Well I read one of ur solutions to sending more tham 16 parameters to > a function in plpgsql. I have changed the value of FUNC_MAX_ARGS > (a/k/a INDEX_MAX_KEYS) in \usr\local\plpgsql\include\config.h after > stoping the postmaster service. > On restarting the service after having changed config.h I am atill > experiencing the same problem. What should I do now? Did you re-init PostgreSQL, and then re-build your database from a pgdump file? I believe that these steps are necessary as well. > If I declare n as integer[3] it gives a compilation error. So I tried > it as above. Can I do any array manipulations at all in plpgsql like > assigning,copying etc values in to other arrays in plpgsql. If so how > ?? No, you can't. Array support in PL/pgSQL is quirky and not all the way there. Jan Wieck has instead been focusing on building CURSOR support into PL/pgSQL so arrays are likely to be unevenly supported for some time unless somebody else takes on the task. Mind you, there have been some proponents of dropping the array data type entirely as not relational (it isn't) so I don't know where this feature is going. Basically, you can declare an array as a parameter of a function, but that's it. You cannnot have array variables or retuurn types. -Josh ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco --_===141632====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===141632====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===141632====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===141632====davinci.ethosmedia.com===_--