Re: operator class "xxx" does not exist for access method "yyy"

From: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
To: Tianyi Gao <gtydoit(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: operator class "xxx" does not exist for access method "yyy"
Date: 2023-03-23 06:09:44
Message-ID: CAFBsxsFAb5T=jbeAa+xyJU3Ge--xAvkPf1hwcHi94GLRrzeOdw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Mar 23, 2023 at 11:38 AM Tianyi Gao <gtydoit(at)gmail(dot)com> wrote:
>
> Thanks for your reply, I have added some SQL statements, such as the
following example when I use the BIT or BIT VARYING type, similar problems
will occur.
>
> postgres=# CREATE TABLE t(c BIT varying(10)) PARTITION BY HASH((t.c));
> ERROR: data type bit varying has no default operator class for access
method "hash"
>
> postgres=# CREATE TABLE t(c BIT) PARTITION BY HASH((t.c));
> ERROR: data type bit has no default operator class for access method
"hash"

According to the documentation:
"Range and list partitioning require a btree operator class, while hash
partitioning requires a hash operator class. If no operator class is
specified explicitly, the default operator class of the appropriate type
will be used; if no default operator class exists, an error will be raised.
When hash partitioning is used, the operator class used must implement
support function 2 (see Section 38.16.3 for details)."

https://www.postgresql.org/docs/devel/sql-createtable.html

--
John Naylor
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message 1024 2023-03-23 08:32:04 An update deadlock bug
Previous Message Sandeep Thakkar 2023-03-23 05:52:48 Re: BUG #17857: Uninstaller does not work