Re: operator class

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "miquel_ibanez" <miquel_ibanez(at)sumimail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: operator class
Date: 2008-02-28 05:30:44
Message-ID: 17912.1204176644@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"miquel_ibanez" <miquel_ibanez(at)sumimail(dot)com> 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bart Degryse 2008-02-28 07:45:51 Re: Function returns error (view)
Previous Message Josh Berkus 2008-02-28 00:45:21 Re: Subselects returning array and ANY...