From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: Sean Davis <sdavis2@mail.nih.gov>
Cc: Veikko Mäkinen <veikko.makinen@ecom.fi>
Cc: pgsql-sql@postgresql.org
Subject: Re: Alias to a type
Date: Wed, 22 Jun 2005 15:14:25 +0300 (EEST)
Message-ID: <Pine.LNX.4.44.0506221513250.4986-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <af9f545f8a3ab4a09d90b2d589443a49@mail.nih.gov>
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
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: achill@matrix.gatewaynet.com, sdavis2@mail.nih.gov, veikko.makinen@ecom.fi
Subject: Re: Alias to a type
In-Reply-To: <Pine.LNX.4.44.0506221513250.4986-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