Hello Hackers, 
I am submitting a patch as part of the Retail DDL functions project described here [1]. This patch creates a function called pg_get_type_ddl designed to retrieve the DDL statement for CREATE TYPE. Users can get the DDL by providing a TYPE name like the following for the ENUM type:
   SELECT pg_get_type_ddl('type_name_enum');
which gives you:
                      pg_get_type_ddl                       
------------------------------------------------------------
 CREATE TYPE public.type_name_enum AS ENUM ('one', 'two', 'three');
I split up the types range, enum, shell, composite, and a base type into different functions which support `pg_get_type_ddl`. Otherwise, the function seemed too long. 
This patch includes documentation, comments, and regression tests, all of which have run successfully.
--