[BUGS] BUG #14564: Unable to create GIN index for character type - Mailing list pgsql-bugs

From volodymyr.volynets@gmail.com
Subject [BUGS] BUG #14564: Unable to create GIN index for character type
Date
Msg-id 20170222160742.1465.72081@wrigleys.postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14564
Logged by:          Volodymyr Volynets
Email address:      volodymyr.volynets@gmail.com
PostgreSQL version: 9.4.5
Operating system:   OSX x86_64-apple-darwin
Description:

Hi,

1) Here's create table statement:

CREATE TABLE cm_countries
(
  cm_country_tenant_id integer NOT NULL,
  cm_country_code character(2) NOT NULL,
  cm_country_name character varying(120) NOT NULL,
  cm_country_code3 character(3) NOT NULL,
  cm_country_number smallint DEFAULT 0,
  cm_country_region_id smallint DEFAULT 0,
  cm_country_sub_region_id smallint DEFAULT 0,
  cm_country_inactive smallint NOT NULL DEFAULT 0,
  CONSTRAINT cm_countries_pk PRIMARY KEY (cm_country_tenant_id,
cm_country_code)
);

2) I added btree_gin extension:

CREATE EXTENSION btree_gin
  SCHEMA pg_catalog
  VERSION "1.0";

3) Trying to create gin index:

CREATE INDEX cm_countries_fulltext_idx ON cm_countries USING gin
(cm_country_code, cm_country_name);

Error:

ERROR:  data type character has no default operator class for access method
"gin"
HINT:  You must specify an operator class for the index or define a default
operator class for the data type.
********** Error **********

ERROR: data type character has no default operator class for access method
"gin"
SQL state: 42704
Hint: You must specify an operator class for the index or define a default
operator class for the data type.

4) Looked into operator classes for gin:

index_method,opclass_name,opfamily_name,indexed_type,is_default
"gin",               "char_ops",      "char_ops",       ""char"",        t



Is it possible to add operator class for type "character" in addition to
type "char"?

Thank you!


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14563: count(*) gives a wrong result in PostgreSQL for some regex with pg_trm/GIN index
Next
From: Devrim Gündüz
Date:
Subject: Re: [BUGS] Error mtk 11009