Re: size of function body

From: Ralph Graulich <maillist(at)shauny(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: size of function body
Date: 2002-07-16 19:37:52
Message-ID: Pine.LNX.4.21.0207162010250.9511-100000@shauny.shauny.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 ...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2002-07-16 19:45:08 Re: table size growing out of control
Previous Message Jason Earl 2002-07-16 19:15:26 Re: timestamped archive data index searches