Currently YugabyteDB doesn't support the Indexes, Primary key and Unique constraints on the various datatypes as mentioned on this docs including few more mentioned below-
daterange
tsrange
tstzrange
numrange
int4range
int8range
interval
Arrays
UDTs
yugabyte=# create table test_types(id int, t tsrange, d daterange, tz tstzrange, n numrange, i4 int4range, i8 int8range, s smallint, inym INTERVAL YEAR TO MONTH, inds INTERVAL DAY TO SECOND(6));
CREATE TABLE
yugabyte=# create index i1 on test_types(t);
ERROR: INDEX on column of type 'user_defined_type' not yet supported
yugabyte=# create index i1 on test_types(d);
ERROR: INDEX on column of type 'user_defined_type' not yet supported
yugabyte=# create index i1 on test_types(tz);
ERROR: INDEX on column of type 'user_defined_type' not yet supported
...
yugabyte=# ALTER TABLE test_types ADD CONSTRAINT uk UNIQUE(d);
ERROR: INDEX on column of type 'user_defined_type' not yet supported
yugabyte=# ALTER TABLE test_types ADD CONSTRAINT pk PRIMARY KEY(d);
NOTICE: table rewrite may lead to inconsistencies
DETAIL: Concurrent DMLs may not be reflected in the new table.
HINT: See https://github.com/yugabyte/yugabyte-db/issues/19860. Set 'ysql_suppress_unsafe_alter_notice' yb-tserver gflag to true to suppress this notice.
ERROR: PRIMARY KEY containing column of type 'user_defined_type' not yet supported
Issue Type
kind/new-feature
Warning: Please confirm that this issue does not contain any sensitive information
[X] I confirm this issue does not contain any sensitive information.
Jira Link: DB-14147
Description
Currently YugabyteDB doesn't support the Indexes, Primary key and Unique constraints on the various datatypes as mentioned on this docs including few more mentioned below-
Issue Type
kind/new-feature
Warning: Please confirm that this issue does not contain any sensitive information