Tim Andersen <timander37@yahoo.com> writes:
> I still have a question about how to get the
> information about length and precision of a column
> from pg_attributes.atttypmod. are there built-in
> functions for PostgreSQL to extract this information?
Best is to rely on the format_type() function. Also, have you thought
about using pg_get_indexdef() in place of all that hacking about in
pg_index?
http://www.postgresql.org/docs/7.3/static/functions-misc.html
In general, your code is less likely to break if you can use the
"catalog information functions" rather than poking around in the
catalogs directly.
regards, tom lane