Re: Custom type, operators and operator class not sorting/indexing correctly

Поиск
Список
Период
Сортировка
От Roger Leigh
Тема Re: Custom type, operators and operator class not sorting/indexing correctly
Дата
Msg-id 20090121104809.GA1029@codelibre.net
обсуждение исходный текст
Ответ на Re: Custom type, operators and operator class not sorting/indexing correctly  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Custom type, operators and operator class not sorting/indexing correctly
Список 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 по дате отправления:

Предыдущее
От: Andreas Wenk
Дата:
Сообщение: Re: pg_restore: [archiver] entry ID -825110830 out of range -- perhaps a corrupt TOC
Следующее
От: "Marc Mamin"
Дата:
Сообщение: Re: Slow update