
I'm trying to add a unique index to a table.  Notice the error message below:


Table    = ordertrack
+----------------------------------+----------------------------------+------+
|              Field               |              Type                |Length|
+----------------------------------+----------------------------------+------+
| ordernumber                      | int8                             |     8|
| total                            | money                            |     4|
| cookie                           | text                             |   var|
| orderseq                         | int4 not null default nextval('o |     4|
+----------------------------------+----------------------------------+------+
Index:    ordertrack_orderseq_key
cloud9=> create unique index ord1 on ordertrack(ordernumber);
ERROR:  Can't find a default operator class for type 20.
cloud9=> 


Is this telling me that I can't have an index of type int8?  Why not?

FreeBSD 2.2.8, PostgreSQL cvsup'd less than a week ago.

Vince.
-- 
==========================================================================
Vince Vielhaber -- KA8CSH   email: vev@michvhf.com   flame-mail: /dev/null
       # include <std/disclaimers.h>                   TEAM-OS2
   Online Searchable Campground Listings    http://www.camping-usa.com
       "There is no outfit less entitled to lecture me about bloat
               than the federal government"  -- Tony Snow
==========================================================================



Sat, 02 Jan 1999 17:18:42 -0500 (EST)
Vince Vielhaber <vev@michvhf.com>
Error creating index
> Is this telling me that I can't have an index of type int8?  Why not?
> FreeBSD 2.2.8, PostgreSQL cvsup'd less than a week ago.

Because I added the int8 data type to the backend without knowing which
platforms would actually support it. (As an aside, I had tried to
solicit results of a small test program for various platforms on the
hackers list, but can't recall getting any responses.)

Without knowing that, it wasn't clear to me whether the int8 would be
able to stay, and I didn't want to embed these changes in the index
support system tables if they would need to be removed. These tables are
the most difficult to configure and support, and it isn't as easy to
trace which entries support which types.

Anyway, it seems int8 indices would be a good feature to have for v6.5,
eh? One could write some user-defined index operators as an interim
solution.

                     - Tom

Mon, 04 Jan 1999 06:22:33 +0000
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
Re: [HACKERS] Error creating index
> Index:    ordertrack_orderseq_key
> cloud9=> create unique index ord1 on ordertrack(ordernumber);
> ERROR:  Can't find a default operator class for type 20.
> cloud9=>

    Reminds me that the new NUMERIC type need's an operator class
    too.  Will take a look at int8 while doing it.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #



Mon, 4 Jan 1999 09:24:01 +0100 (MET)
jwieck@debis.com (Jan Wieck)
Re: [HACKERS] Error creating index
> Index:    ordertrack_orderseq_key
> cloud9=> create unique index ord1 on ordertrack(ordernumber);
> ERROR:  Can't find a default operator class for type 20.
> cloud9=>

    Reminds me that the new NUMERIC type need's an operator class
    too.  Will take a look at int8 while doing it.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #




Mon, 4 Jan 1999 09:24:01 +0100 (MET)
orion.SAPserv.Hamburg.dsh.de!wieck@sapserv.debis.de
Re: [HACKERS] Error creating index