Re: [HACKERS] A bug or a feature? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] A bug or a feature?
Date
Msg-id 9306.943423660@sss.pgh.pa.us
Whole thread Raw
In response to A bug or a feature?  (Alessio Bragadini <alessio@albourne.com>)
List pgsql-hackers
Alessio Bragadini <alessio@albourne.com> writes:
> We have a table with ~30 columns, named 'people' and we were going to
> create a view for all record with 'relationship' equal to 1. The
> database complains where using the '*' placeholder:
> albourne=> CREATE VIEW employees AS SELECT * FROM people WHERE
> relationship = 1; 
> ERROR:  DefineQueryRewrite: rule plan string too big.
> but accepts the same 30 columns on the command:

There is a limit on the length of rule plans :-(.  Jan has implemented
compression of rule plan strings as a partial workaround for 7.0, and
the final solution will come when we eliminate tuple length limits.

In the meantime, the interesting question is why two apparently
equivalent queries yield rule plans of different lengths.  As far as
I can tell, '*' and explicitly listing the fields *do* yield exactly
the same results.  My guess is that your query is right at the hairy
edge of the length limit, such that one or two characters more or less
make the difference.  The rule plan does include a couple of instances
of the name of the view, so if you used a longer view name in one case
than the other, that could explain why one worked and the other didn't.

If that's not it then I'm baffled...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: AW: [HACKERS] Getting OID in psql of recent insert
Next
From: Tatsuo Ishii
Date:
Subject: pid file for postmaster?