Thread: Creating simple type aliases

Creating simple type aliases

From
Peter Haworth
Date:
Is it possible to create an alias for an existing type, so that I can refer to
it with a simple name, and possibly change it in the future? Something like:

  create type-alias issn as char(9)

Without that it looks like I have to do

  create type issn (
    input=charin, output=charout,
    internallength=9, externallength=9,
    element='char'
  )
then insert a row to pg_opclass, after attempting to use the new type to find
its ID.

Surely there's an easier way?

--
    Peter Haworth    pmh@edison.ioppublishing.com
"Never tell people how to do things.
 Tell them WHAT to do and they will surprise you with their ingenuity."
        -- Gen. George S. Patton, Jr.