Re: Custom type, operators and operator class not sorting/indexing correctly - Mailing list pgsql-general

From Roger Leigh
Subject Re: Custom type, operators and operator class not sorting/indexing correctly
Date
Msg-id 20090121104809.GA1029@codelibre.net
Whole thread Raw
In response to Re: Custom type, operators and operator class not sorting/indexing correctly  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Custom type, operators and operator class not sorting/indexing correctly  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
On Wed, Jan 21, 2009 at 02:03:03AM -0500, Tom Lane wrote:
> Roger Leigh <rleigh@codelibre.net> writes:
> > I've created a new domain (debversion) derived from TEXT, which
> > includes its own operators (< <= = >= > and <>), and also its
> > own operator class for BTREE indices.
>
> You can't realistically attach such things to a domain; try making
> a separate type, perhaps with an implicit cast to text to allow
> use of text operators for other purposes.

Ah, thanks for the clarification.  So I need to use CREATE TYPE
rather than CREATE DOMAIN.  Because I'm essentially just storing
a text string with different operators, can I derive a type from
TEXT (perhaps by reusing the same input, output, receive and send
functions as TEXT?)  I saw the textsend and textreceive functions,
which I assume are the appropriate functions for send and receive?
Are there any for input and output which I may reuse?


Many thanks,
Roger

--
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

pgsql-general by date:

Previous
From: Andreas Wenk
Date:
Subject: Re: pg_restore: [archiver] entry ID -825110830 out of range -- perhaps a corrupt TOC
Next
From: "Marc Mamin"
Date:
Subject: Re: Slow update