Format Typmod?

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Format Typmod?
Дата
Msg-id 4D34B4E6-E2CD-4D60-A607-65599BEC9D42@kineticode.com
обсуждение исходный текст
Список pgsql-hackers
Hey Hackers,

I just had reason to want the way that format_type converts type names (e.g., varchar => character varying) in pgTAP,
butdidn't want the namespace qualification (used by format_type() when the type in question is not visible). I figured
outthat I could get that conversion by simply casting the OID argument to regtype, but then to get the typmod, I still
haveto use format_type() like so: 
   CREATE OR REPLACE FUNCTION display_type ( OID, INTEGER )   RETURNS TEXT AS $$       SELECT $1::regtype || COALESCE(
        substring(pg_catalog.format_type($1, $2), '[(][^)]+[)]$'),       '')   $$ LANGUAGE SQL; 

Is there a saner way to do it than this? That is, is there a better way to get the typmod than by munging the value
returnedby format_type()? 

Thanks,

David

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: First feature patch for plperl - draft [PATCH]
Следующее
От: Robert Haas
Дата:
Сообщение: Re: operator exclusion constraints