Alias to a type

From: Veikko Mäkinen <veikko(dot)makinen(at)ecom(dot)fi>
To: pgsql-sql(at)postgresql(dot)org
Subject: Alias to a type
Date: 2005-06-22 11:27:46
Message-ID: 42B94B32.5040707@ecom.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hey,

Is it possible to create a new type as an alias to a pre-defined type? I
use "USERID varchar(20)" in almost every table I have I'd like to make
an alias for that type eg.

<pseudo-sql>
create type myschema.useridtype as varchar(20);
</pseudo-sql>

I might have to alter the type some day and this way I'd have to just
re-define the alias. Can this be achieved by creating a new type with
CREATE TYPE? What are the input/output functions in the CREATE TYPE
definition?

Thanks.

-veikko

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleus Mantzios 2005-06-22 11:42:20 Re: Alias to a type
Previous Message Mukesh Ghatiya 2005-06-22 09:26:08 cross-table reference