INDEX broken on NUMERIC type.

Started by Michael J Schoutover 26 years ago3 messagesbugs
Jump to latest
#1Michael J Schout
mschout@gkg.net

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Michael Schout
Your email address : mschout@gkg.net

System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel Pentium-II

Operating System (example: Linux 2.0.26 ELF) : Linux 2.2.12 ELF

PostgreSQL version (example: PostgreSQL-6.5.2): PostgreSQL-6.5.2

Compiler used (example: gcc 2.8.0) : gcc egcs-2.91.66

Please enter a FULL description of your problem:
------------------------------------------------

NUMERIC type cannot be used in an INDEX.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

Method (1) using primary key syntax:
scdrought=> create table foo ( f1 NUMERIC(3,0) primary key );
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo'
ERROR: Can't find a default operator class for type 1700.

Method (2) do it by hand.
mschout=> create table foo (f1 NUMERIC(3,0));
CREATE
mschout=> CREATE UNIQUE INDEX foo_pkey ON foo (f1);
ERROR: Can't find a default operator class for type 1700.

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

#2Bruce Momjian
bruce@momjian.us
In reply to: Michael J Schout (#1)
Re: [BUGS] INDEX broken on NUMERIC type.

We don't support it yet. It is on the TODO list.

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Michael Schout
Your email address : mschout@gkg.net

System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel Pentium-II

Operating System (example: Linux 2.0.26 ELF) : Linux 2.2.12 ELF

PostgreSQL version (example: PostgreSQL-6.5.2): PostgreSQL-6.5.2

Compiler used (example: gcc 2.8.0) : gcc egcs-2.91.66

Please enter a FULL description of your problem:
------------------------------------------------

NUMERIC type cannot be used in an INDEX.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

Method (1) using primary key syntax:
scdrought=> create table foo ( f1 NUMERIC(3,0) primary key );
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo'
ERROR: Can't find a default operator class for type 1700.

Method (2) do it by hand.
mschout=> create table foo (f1 NUMERIC(3,0));
CREATE
mschout=> CREATE UNIQUE INDEX foo_pkey ON foo (f1);
ERROR: Can't find a default operator class for type 1700.

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

************

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3Christof Petig
christof.petig@wtal.de
In reply to: Bruce Momjian (#2)
Re: [BUGS] INDEX broken on NUMERIC type.

If you know how this problem might be fixed, list the solution below:

CREATE TABLE "bn_summary" (
"maschine" numeric(3,0) NOT NULL);
CREATE INDEX "bn_summary_key0" on "bn_summary" using btree ( "maschine"
"int2_ops" );

works for me, though I don't know if this is recommended.

Regards
Christof