Re: Functions have 32 args limt ???

From: Dennis Gearon <gearond(at)fireserve(dot)net>
To: Ivar <ivar(at)lumisoft(dot)ee>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Functions have 32 args limt ???
Date: 2003-08-28 15:20:17
Message-ID: 3F4E1DB1.3030206@fireserve.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It might be possible to use an array.

Ivar wrote:

>It all depends what soft are you doing.
>
>There is for example material card function.
>It it designed so bad that it has more than 32 ars.
>Why must split this function if behind UI I use it as single function for
>adding updateing material ???
>
>CREATE OR REPLACE FUNCTION
>wpr_M_I_MaterialCard_Doc(int,varchar,varchar,varchar,varchar,boolean,boolean
>,boolean,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar,var
>char,varchar,varchar,varchar,numeric,varchar,numeric,numeric,numeric,numeric
>,numeric,numeric,boolean,boolean,boolean,varchar,varchar,varchar,numeric)
> RETURNS void AS '
>DECLARE
>
>
> @DocAction ALIAS FOR $1;
> -- 1 - Load Document
> -- 2 - Update Header
> -- 3 - New Document
> -- 4 - Document Delete
> @SessionID ALIAS FOR $2; -- Session ID
> @LockID ALIAS FOR $3; -- Lock ID
> @Lang ALIAS FOR $4; -- Language
> @DocID ALIAS FOR $5; -- Material Parameter ID
> @AltG ALIAS FOR $6; -- 1 kui valitakse Funtsionaalse
>Grupeeringu alusel
> @NoData ALIAS FOR $7; -- 1, Kui eii vC?ljastata andmeid
> @ProductUpd ALIAS FOR $8; -- 1, Kui avatakse korrigeerimiseks
>tootekirjelduse alt
>
> @StocCode ALIAS FOR $9; -- Ladu
> @MainGroupCode ALIAS FOR $10; -- PeaGrupp
> @SubGroupCode ALIAS FOR $11; -- AlaGrupp
> @ExtraGroupCode ALIAS FOR $12; -- TC?iendav Grupp
> @AltMainGroupCode ALIAS FOR $13; -- Funtsionnalne PeaGrupp
> @AltSubGroupCode ALIAS FOR $14; -- Funtsionnalne AlaGrupp
> @AltExtraGroupCode ALIAS FOR $15; -- Funtsionnalne TC?iendav Grupp
> @MatCode ALIAS FOR $16; -- Kood
> @Suffix ALIAS FOR $17; -- Positsioon
> @BarCode ALIAS FOR $18; -- Triipkood
> @MatName ALIAS FOR $19; -- Nimetus
> @MeasureUnit ALIAS FOR $20; -- MŨŨtC?hik
> @InPackage ALIAS FOR $21; -- C?hikut Pakis
> @CurrencyCode ALIAS FOR $22; -- Valuuta
> @EtalonPrice ALIAS FOR $23; -- EtalonHind
> @Discount ALIAS FOR $24; -- Soodustus
> @NullPrice ALIAS FOR $25; -- NullHind
> @NullPrice_VAT ALIAS FOR $26; -- NullHind KM-ga
> @CostPlusPercent ALIAS FOR $27; -- Juurdehindlus %
> @VATPercent ALIAS FOR $28; -- KC?ibemaksu %
> @NotInPriceList ALIAS FOR $29; -- 1, Kui ei kuulu hinnakirja
> @Closed ALIAS FOR $30; -- 1, Kui on Suletud
> @Product ALIAS FOR $31; -- 1, Kui on Toode
> @Warranty ALIAS FOR $32; -- Garantii tekst
> @Info ALIAS FOR $33; -- Info
> @MatDebit ALIAS FOR $34; -- Materjali Konto
> @KASTIS ALIAS FOR $35; --,@KASTIS numeric(18,3) =NULL --
>C?hikut Kastis (Konteineris)
>BEGIN
>
>"Dennis Gearon" <gearond(at)fireserve(dot)net> wrote in message
>news:3F4E0C5F(dot)40804(at)fireserve(dot)net(dot)(dot)(dot)
>
>
>>Ivar wrote:
>>
>>
>>
>>>I don't see why default is so small.
>>>
>>>"Joe Conway" <mail(at)joeconway(dot)com> wrote in message
>>>news:3F4D8DE0(dot)1060307(at)joeconway(dot)com(dot)(dot)(dot)
>>>
>>>
>>>
>>>
>>>>Ivar wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>For my supprise I found that functions have 32 parameter limit.
>>>>>
>>>>>Where to find more info about this limitation or similar limitations ?
>>>>>
>>>>>I need at least 50, 100 would be ok.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>See INDEX_MAX_KEYS defined in src/include/pg_config.h.in
>>>>(pg_config_manual.h in postgres 7.4). Change to 64 or whatever and
>>>>recompile. But note that you'll need to dump, initdb, and reload your
>>>>data. Also note that there are performance and disk usage tradeoffs --
>>>>search the mailing list archives from August 2002 for some test results
>>>>and discussion.
>>>>
>>>>Joe
>>>>
>>>>
>>>>---------------------------(end of broadcast)---------------------------
>>>>TIP 9: the planner will ignore your desire to choose an index scan if
>>>>
>>>>
>your
>
>
>>>> joining column's datatypes do not match
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>---------------------------(end of broadcast)---------------------------
>>>TIP 4: Don't 'kill -9' the postmaster
>>>
>>>
>>>
>>>
>>>
>>32 is small? I've never designed a function with more than 12-18, at teh
>>MOST, arguments.
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 2: you can get off all lists at once with the unregister command
>> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>>
>>
>>
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ivar 2003-08-28 15:22:02 Re: Functions have 32 args limt ???
Previous Message Ivar 2003-08-28 15:19:46 Re: Functions have 32 args limt ???