yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
9.01k stars 1.07k forks source link

[YSQL] ltree not working with "UNIQUE" constraints #10488

Open lei-splashtop opened 3 years ago

lei-splashtop commented 3 years ago

Jira Link: DB-1303

Description

Env:

OS:

MacOS Monterey 12.0

Chip:

Apple M1 Pro

Docker version:

yugabytedb/yugabyte:2.9.1.0-b140

Steps to reproduce:

docker run -d --name yugabyte -p7001:7000 -p9000:9000 -p5433:5433 -p9042:9042 yugabytedb/yugabyte:latest bin/yugabyted start --daemon=false docker exec -it yugabyte /home/yugabyte/bin/ysqlsh --echo-queries

Create table without UNIQUE works fine:

CREATE EXTENSION IF NOT EXISTS ltree; yugabyte=# CREATE TABLE test_not_null (path ltree NOT NULL); CREATE TABLE test_not_null (path ltree NOT NULL); CREATE TABLE

Create table with UNIQUE constraints will get ERROR:

CREATE TABLE test_unique (path ltree UNIQUE); ERROR: data type ltree has no default operator class for access method "lsm" HINT: You must specify an operator class for the index or define a default operator class for the data type.

lei-splashtop commented 3 years ago

on MacOS with Intel Chip also has this issue