DefineQueryRewrite: rule plan string too big.

From: Theo Kramer <theo(at)flame(dot)co(dot)za>
To: pgsql-hackers(at)postgresql(dot)org
Subject: DefineQueryRewrite: rule plan string too big.
Date: 2000-01-17 14:28:43
Message-ID: 3883271B.518645BA@flame.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

Just created a rule and received "rule plan string too big". My rule is around
1000 characters long. I added a debug statement which printed the following from
backend/rewrite/rewriteDefine.c

sizeof(FormData_pg_rewrite) = 60, strlen(actionbuf) = 6328, strlen(qualbuf) = 4279, MaxAttrSize = 8104

so my rule expands to 10667 characters.

Questions I have
1. Is it feasable to increase MaxAttrSize without upsetting the applecart?

2. Does this limitation not severely restrict setting up of rules? Ie. I
want to log any update on any field made to a 16 attribute table.

The rule is as follows

create rule log_accounts as on update to accounts
where new.domain != old.domain or
new.RegistrationDate != old.RegistrationDate or
new.RegistrationType != old.RegistrationType or
new.Amount != old.Amount or
new.BillingType != old.BillingType or
new.ContactEmail != old.ContactEmail or
new.PaperDate != old.PaperDate or
new.PaymentDate != old.PaymentDate or
new.InvoiceCount != old.InvoiceCount or
new.InvoiceNo != old.InvoiceNo or
new.ContractType != old.ContractType or
new.Organisation != old.Organisation or
new.Payed != old.Payed
do insert into accounts_log values (
getpgusername(),
'now'::text,
new.domain,
new.RegistrationDate,
new.RegistrationType,
new.Amount,
new.BillingType,
new.ContactEmail,
new.PaperDate,
new.PaymentDate,
new.InvoiceCount,
new.InvoiceNo,
new.ContractType,
new.Organisation,
new.Payed,
new.PaperContract
);

3. Is there a better way to do this?

TIA
--------
Regards
Theo

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Elphick 2000-01-17 14:34:06 psql and COPY
Previous Message Hakan Tandogan 2000-01-17 14:20:32 Re: [HACKERS] Auto-lowercasing of column names?