pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: Veikko Mäkinen <veikko.makinen@ecom.fi>
Cc: pgsql-sql@postgresql.org
Subject: Re: Alias to a type
Date: Wed, 22 Jun 2005 14:42:20 +0300 (EEST)
Message-ID: <Pine.LNX.4.44.0506221440440.4771-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <42B94B32.5040707@ecom.fi>

O Veikko Mäkinen Ýãñáøå óôéò Jun 22, 2005 :

> 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>
> 

Try something like

CREATE DOMAIN my_integer AS INTEGER;

> 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
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 

-- 
-Achilleus




view thread (8+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0506221440440.4771-100000@matrix.gatewaynet.com>
Permalink:  ../Pine.LNX.4.44.0506221440440.4771-100000@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0506221440440.4771-100000@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: achill@matrix.gatewaynet.com, veikko.makinen@ecom.fi
  Subject: Re: Alias to a type
  In-Reply-To: <Pine.LNX.4.44.0506221440440.4771-100000@matrix.gatewaynet.com>
  References: <42B94B32.5040707@ecom.fi> <Pine.LNX.4.44.0506221440440.4771-100000@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox