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 3522B5285C for ; Wed, 22 Jun 2005 10:14:08 -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 15860-05 for ; Wed, 22 Jun 2005 13:14:01 +0000 (GMT) Received: from mx1.lansilinkki.net (mx1.lansilinkki.net [212.83.96.242]) by svr1.postgresql.org (Postfix) with ESMTP id 56B875284D for ; Wed, 22 Jun 2005 10:13:59 -0300 (ADT) Received: from [127.0.0.1] (ecom-174.postikaista.net [80.74.214.174]) by mx1.lansilinkki.net (8.12.10/8.12.10) with ESMTP id j5MDE0hj015998 for ; Wed, 22 Jun 2005 16:14:03 +0300 (EEST) Message-ID: <42B96421.5010906@ecom.fi> Date: Wed, 22 Jun 2005 16:14:09 +0300 From: =?ISO-8859-1?Q?Veikko_M=E4kinen?= User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Alias to a type References: <42B94B32.5040707@ecom.fi> <42B95465.2060708@archonet.com> In-Reply-To: <42B95465.2060708@archonet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/270 X-Sequence-Number: 21871 Richard Huxton wrote: > Veikko Mäkinen wrote: > >> 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 DOMAIN username_string AS varchar(20); > > Test it with your client applications though, make sure they cope. Some > don't cope well with user-defined types. Splendid, thank you all :) I'm quite sure loosely typed PHP can cope with my user-defined types ;) But now I need a better modeling tool because Azzurri Clay 1.1 (Eclipse plug-in) doesn't let me define new types... Any suggestions? SQL DDL generation is the only demand I really have. -veikko