X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1F1A7528A8 for ; Wed, 22 Jun 2005 09:28:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07655-06 for ; Wed, 22 Jun 2005 12:28:17 +0000 (GMT) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id DDC1B5284D for ; Wed, 22 Jun 2005 09:28:15 -0300 (ADT) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id j5MCEPBS004991; Wed, 22 Jun 2005 15:14:25 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id j5MCEPDV004987; Wed, 22 Jun 2005 15:14:25 +0300 Date: Wed, 22 Jun 2005 15:14:25 +0300 (EEST) From: Achilleus Mantzios To: Sean Davis Cc: =?ISO-8859-1?Q?Veikko_M=E4kinen?= , Subject: Re: Alias to a type In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/269 X-Sequence-Number: 21870 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. > >> > >> > >> create type myschema.useridtype as varchar(20); > >> > >> > > > > 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