Re: Alias to a type

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
Cc: Veikko Mäkinen <veikko(dot)makinen(at)ecom(dot)fi>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Alias to a type
Date: 2005-06-22 12:14:25
Message-ID: Pine.LNX.4.44.0506221513250.4986-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

O Sean Davis έγραψε στις Jun 22, 2005 :

>
> On Jun 22, 2005, at 7:42 AM, Achilleus Mantzios wrote:
>
> > 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;
>
> Just for my own edification, does creating a "simple" domain like this
> then require a whole set of functions for indexing, etc., like other
> more complex user-defined types, or will postgres "do the right thing"?

In the above example you may safely consider indexing columns
of type my_integer as indexing INTEGERs.

>
> Thanks,
> Sean
>
>

--
-Achilleus

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2005-06-22 12:18:06 Re: Alias to a type
Previous Message Richard Huxton 2005-06-22 12:07:01 Re: Alias to a type