Subject: Tuple is too big

From: "Raymond Frost (305) 284-3969" <[email-masked]>
Date: Mon, 13 Jul 92 11:34:38 -0700

Any help in determining why the following series of commands results
in an error message would be greatly appreciated.

create root
	(client = int2,
	amtreq = float4,
	amtauth = float4,
	netmonth = float4,
	housemonth = float4,
	othermonth = float4,
	appr = float4,
	apprver = float4,
	dpmnt = float4,
	rate = float4,
	bankrupt = bool,
	points = float4,
	miscclose = float4,
	reqliq = float4,
	citizen = bool,
	resalien = bool) \g

create final (grantloan = bool) inherits (root) \g

create trace (client = int2,
		node = char16) \g
	
define rule pledge6 is
on append to root
where new.reqliq > ("8.0"::float4 * new.housemonth)
do [
	append trace (node = "pledge6"::char16, client = new.client)
	append final 
	   (new.all, grantloan = "t"::bool,
	   amtauth = ("0.70"::float4 * new.appr))
	delete root
]
\g

Query sent to backend is "define rule pledge6 is on append to root where new.reqliq > ("8.0"::float4 * new.housemonth) do [     append trace (node = "pledge6"::char16, client = new.client)    append final       (new.all, grantloan = "t"::bool,        amta
WARN:Jul 13 14:31:11:Tuple is too big: size 9748

Thanks,

Raymond Frost
University of Miami

---

From: <[email-masked]>
Date: Tue, 14 Jul 92 13:46:15 PDT

In message <[email-masked]> you write:

> Query sent to backend is "define rule pledge6 is on append to root where new.
  +reqliq > ("8.0"::float4 * new.housemonth) do [     append trace (node = "ple
  +dge6"::char16, client = new.client)    append final       (new.all, grantloa
  +n = "t"::bool,        amta
> WARN:Jul 13 14:31:11:Tuple is too big: size 9748

in postgres release 3 (and in release 4), the rule system stores query
plans in ordinary tuples.  this means that when you define a rule, the
rule system generates a query plan from it and then stores the plan,
as a varlena, as an attribute of a tuple in a distinguished relation.

postgres doesn't permit tuples to span multiple pages, so this puts
an effective limit of 8kBytes minus epsilon on the length of a rule
plan string.  your rule generated a plan string longer than that.

we intend to store rule plans as large objects in a future postgres
release.  for the time being, you should break up your rule into a
set of smaller rules, if you can.

					mike olson
					project sequoia 2000
					uc berkeley
					[email-masked]