Peter Eisentraut <peter_e@gmx.net> writes:
> In turn I'm thinking that it might be nice to have a backend function like
> format_type(name[, int4]) that formats an internal type and any size
> modifier for client consumption, like
> format_type('varchar', 8) => "CHARACTER VARYING(8)"
> format_type('my type') => "\"my type\""
> format_type('numeric', {xxx}) => "NUMERIC(9,2)"
> That could put an end to keeping track of backend implementation details
> in psql, pg_dump, and friends.
Seems like a good idea, though I think it's a bit late in the 7.0 cycle
for such a change. Maybe for 7.1?
Also, I assume you mean that the int4 arg would be the typmod value ---
your examples are not right in detail for that interpretation.
regards, tom lane