Re: [HACKERS] Error "vacuum pg_proc" - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Error "vacuum pg_proc"
Date
Msg-id 12358.946050770@sss.pgh.pa.us
Whole thread Raw
In response to Error "vacuum pg_proc"  (Mateus Cordeiro Inssa <mateus@ifnet.com.br>)
Responses Re: [HACKERS] Error "vacuum pg_proc"
Re: [HACKERS] Error "vacuum pg_proc"
List pgsql-hackers
Mateus Cordeiro Inssa <mateus@ifnet.com.br> writes:
>   I got this error vacuuming pg_proc:
> ERROR:  _bt_endpoint: leftmost page (20) has not leftmost flag

Hmm, I wonder if this could be yet another manifestation of the problems
that btree indexes have with oversized key values.  Do you have any
procedures with long definitions?  "Long" in this context means over
about 4K.  If you're not sure, tryselect proname from pg_proc where length(prosrc) > 4000;

If you do, try breaking them up into smaller procedures.  You might have
to dump and rebuild the database to get rid of the corruption in
pg_proc's index, though.

The reason this is an issue is that btree wants to be able to store at
least two index tuples per disk page, so it has problems with indexing
values over half-a-page-less-overhead.  I'm not sure exactly what the
critical size is, but it is somewhere around 4000 bytes.  And pg_proc
has an index on the prosrc field.

The prosrc index is actually completely unnecessary, so we've removed
it for 7.0.  Work is in progress to fix the tuple-size problem as well,
but that will probably take longer.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] T-O-A-S-T meaning
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Source code format votes