Attached is a patch which implements, as discussed briefly on -hackers, a user-visible function to get at the information that convert_to_scalar uses to generate selectivity estimates.
The main use case for this is for tools such as pgadmin which want to make sense of the histograms, they need to know where and how tall to draw each region of the histogram. I didn't add any documentation because I couldn't find a reasonable place to put such a low level function. I don't think we would want to encourage applications to use it unless they're trying to work with statistics tables anyways so documenting it on the comparison operators page -- the only page where it seems it would make sense -- would be a bad idea.
pg_convert_to_scalar.patch.gz
Description: Binary data
-- Gregory Stark EnterpriseDB http://www.enterprisedb.com
---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate