"David E. Wheeler" <david@justatheory.com> writes:
> The only way I can think of to avoid that is to:
> 1. Add a to_regtypmod() for those who just want the typemod.
Seems like there's a good case for doing that.
> 2. Add a format_type_string() function that returns a string, the equivalent of this function but in C:
> CREATE FUNCTION format_type_string(text) RETURNS TEXT AS $$
> SELECT format_type(to_regtype($1), to_regtypmod($1))
> $$;
I'm less thrilled about that, mainly because I can't think of
a good name for it ("format_type_string" is certainly not that).
Is the use-case for this functionality really strong enough that
we need to provide it as a single function rather than something
assembled out of spare parts?
regards, tom lane