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 6EFE552812 for ; Wed, 22 Jun 2005 09:04:44 -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 01259-10 for ; Wed, 22 Jun 2005 12:04:41 +0000 (GMT) Received: from mx5.net.nih.gov (mx5.net.nih.gov [165.112.130.36]) by svr1.postgresql.org (Postfix) with ESMTP id B34F352806 for ; Wed, 22 Jun 2005 09:04:39 -0300 (ADT) Received: from mx5.net.nih.gov (localhost [127.0.0.1]) by mx5.net.nih.gov (8.12.10/8.11.6) with ESMTP id j5MC4eWA011654 for ; Wed, 22 Jun 2005 08:04:43 -0400 Received: from [128.231.145.14] (holmes.nhgri.nih.gov [128.231.145.14]) by mx5.net.nih.gov (8.12.10/8.11.6) with ESMTP id j5MC4eYk011651; Wed, 22 Jun 2005 08:04:40 -0400 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=UTF-8; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable Cc: =?ISO-8859-1?Q?Veikko_M=E4kinen?= , pgsql-sql@postgresql.org From: Sean Davis Subject: Re: Alias to a type Date: Wed, 22 Jun 2005 08:04:39 -0400 To: Achilleus Mantzios X-Mailer: Apple Mail (2.622) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/266 X-Sequence-Number: 21867 On Jun 22, 2005, at 7:42 AM, Achilleus Mantzios wrote: > O Veikko M=CE=B4kinen =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5 =CF=83=CF=84=CE= =B9=CF=82 Jun 22, 2005 : > >> Hey, >> >> Is it possible to create a new type as an alias to a pre-defined=20 >> 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=20= then require a whole set of functions for indexing, etc., like other=20 more complex user-defined types, or will postgres "do the right thing"? Thanks, Sean