Re: size of function body - Mailing list pgsql-general

From Ralph Graulich
Subject Re: size of function body
Date
Msg-id Pine.LNX.4.21.0207162010250.9511-100000@shauny.shauny.de
Whole thread Raw
In response to Re: size of function body  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: size of function body
List pgsql-general
Hi,


[...]
>> a function body can't be larger than the defined postgres'
>>block size, which defaults to 8192 byte.
> Say what?  That hasn't been true since TOAST was introduced in 7.1.

Just read about the possible errors and thought I was running into this
one. But as you said, this limit was widened with 7.1 and onwards, I seem
to have an other problem.

Given a function with 29 parameters, consisting of 5 INTEGERs and the rest
being VARCHARs, reALIASing all the parameter in the DECLARE block and
using them in several SQL statements within the function's body, I began
to receive that error:

ERROR:  parser: parse error at or near "SELECT" 89299<

The plain text size of the function is:

8190 Jul 16 21:31 function_update_dam.func

which counts for 8190 bytes. So I just doubled a simple UPDATE-Statement
at the end of the function just to get the code size larger than 8192
bytes.

UPDATE dam_key_family_4 SET fam_dosage_idx='54.5fs';

Just doubled that statement.

And the error occurs again (just using NULL for testing)

SELECT update_dam(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

ERROR:  parser: parse error at or near "SELECT" 90122<

Things I recognized:

The numbers after the "SELECT" get higher each time I try the statement
and seems to wrap around in the negative range, when it reaches values
larger than 1,000,000 (presumably 1,048,576?).

Difficult to describe, just tell me what more detailled information you
need.


Kind regards
... Ralph ...



pgsql-general by date:

Previous
From: "Dorward Villaruz"
Date:
Subject: no keys...
Next
From: Robert Treat
Date:
Subject: Re: table size growing out of control