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
a16 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.InvoiceNoor 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