OK, here's the (hopefully final) version of the typanalyze function for tsvectors. It applies to HEAD and passes regression tests.
I now plan to move towards a selectivity function that'll use the gathered statistics.
Thanks to everyone for their reviews and comments,
-- Jan UrbanskiGPG key ID: E583D7D2