pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: miquel_ibanez <miquel_ibanez@sumimail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: operator class
Date: Thu, 28 Feb 2008 00:30:44 -0500
Message-ID: <17912.1204176644@sss.pgh.pa.us> (raw)
In-Reply-To: <000e01c87991$cab4bb40$6402a8c0@miguelvell>
References: <000e01c87991$cab4bb40$6402a8c0@miguelvell>

"miquel_ibanez" <miquel_ibanez@sumimail.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



view thread (2+ messages)

Message-ID: <17912.1204176644@sss.pgh.pa.us>
Permalink:  ../17912.1204176644@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17912.1204176644@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, miquel_ibanez@sumimail.com
  Subject: Re: operator class
  In-Reply-To: <17912.1204176644@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox