Обсуждение: Error creating index

Поиск
Список
Период
Сортировка

Error creating index

От
Vince Vielhaber
Дата:
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
entitledto lecture me about bloat              than the federal government"  -- Tony Snow
 
==========================================================================




Re: [HACKERS] Error creating index

От
"Thomas G. Lockhart"
Дата:
> 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


Re: [HACKERS] Error creating index

От
jwieck@debis.com (Jan Wieck)
Дата:
> 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) #

Re: [HACKERS] Error creating index

От
orion.SAPserv.Hamburg.dsh.de!wieck@sapserv.debis.de
Дата:
> 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) #