Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 041102E0051 for ; Thu, 28 Feb 2008 01:30:49 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 19297-06 for ; Thu, 28 Feb 2008 01:30:45 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 7067B2E004D for ; Thu, 28 Feb 2008 01:30:45 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m1S5Ui7L017913; Thu, 28 Feb 2008 00:30:44 -0500 (EST) To: "miquel_ibanez" cc: pgsql-sql@postgresql.org Subject: Re: operator class In-reply-to: <000e01c87991$cab4bb40$6402a8c0@miguelvell> References: <000e01c87991$cab4bb40$6402a8c0@miguelvell> Comments: In-reply-to "miquel_ibanez" message dated "Wed, 27 Feb 2008 23:40:45 +0100" Date: Thu, 28 Feb 2008 00:30:44 -0500 Message-ID: <17912.1204176644@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/231 X-Sequence-Number: 30322 "miquel_ibanez" writes: > CREATE TYPE t_cod_t_activ AS ( > cod_t_activ CHAR(10) > ); If you just want an alias for char(10), a domain would probably work better. CREATE TYPE AS is meant for creating multi-field row types. > Does it mean that I cannot create an index on a field wich is of a type > defined by the user? Sure, if you are also willing to define operators and operator classes on your type. regards, tom lane