Thread: More Rule creation problems (and nowhere near 8K)

More Rule creation problems (and nowhere near 8K)

From
"Neil Burrows"
Date:
Hi,

I am having a problem trying to create a rule on a view and keep getting

ERROR:  DefineQueryRewrite: rule plan string too big.


I've looked though the mailing list and docs and have seen mentions that
the limit of a rule is 8192 characters.  The rule (see below) is no more
than 600 characters as it is and the error still appears even when all the
whitespace is removed.

Is this correct and if so what is the actual limit for the length of a
rule?

I am currently using PostgreSQL 6.5.3.

Thanks.


--
-- Rule to INSERT & add correct date
--
CREATE RULE customer_insert AS ON INSERT TO customers
DO INSTEAD INSERT INTO customer_table
VALUES (NEXTVAL('customer_seq'), new.company, new.forename,
    new.surname,LOWER(new.username), new.password, new.address1,
    new.address2, new.address3, new.town, new.postcode, new.day_phone,
    new.evening_phone, new.fax, new.mobile, new.package,
    current_datetime(), current_datetime(), new.suspended,
    new.suspended_date, new.deleted, new.deleted_date, new.comments);



Regards,

---[  Neil Burrows  ]-----------------------------------------------------
E-mail: neil@pawprint.co.uk              |   You're only young once, but
Web   : http://www.remo.demon.co.uk/     |  you can stay immature forever
-------< PGP Key available from http://www.remo.demon.co.uk/pgp/ >--------

Re: [GENERAL] More Rule creation problems (and nowhere near 8K)

From
Ed Loehr
Date:
Neil Burrows wrote:

> Hi,
>
> I am having a problem trying to create a rule on a view and keep getting
>
> ERROR:  DefineQueryRewrite: rule plan string too big.
>
> I've looked though the mailing list and docs and have seen mentions that
> the limit of a rule is 8192 characters.  The rule (see below) is no more
> than 600 characters as it is and the error still appears even when all the
> whitespace is removed.

If I read the previous comments on this topic correctly, it's not the length
of your query that matters, but rather the length of what your query gets
translated into... a very annoying bug, indeed.  This is the number one
barrier to my ODBC use as it makes views pretty much unusable.

Cheers,
Ed Loehr