diff --git a/migtests/tests/analyze-schema/expected_issues.json b/migtests/tests/analyze-schema/expected_issues.json index ff65149253..b28a95814b 100644 --- a/migtests/tests/analyze-schema/expected_issues.json +++ b/migtests/tests/analyze-schema/expected_issues.json @@ -189,171 +189,6 @@ "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#data-ingestion-on-xml-data-type-is-not-supported", "MinimumVersionsFixedIn": null }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx1 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'cidr' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx1 on combined_tbl (c);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx2 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'circle' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx2 on combined_tbl (ci);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx3 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'box' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx3 on combined_tbl (b);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx4 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'json' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx4 on combined_tbl (j);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx5 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'line' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx5 on combined_tbl (l);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx6 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'lseg' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx6 on combined_tbl (ls);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx7 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'macaddr' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx7 on combined_tbl (maddr);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx8 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'macaddr8' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx8 on combined_tbl (maddr8);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx9 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'point' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx9 on combined_tbl (p);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx10 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'pg_lsn' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx10 on combined_tbl (lsn);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx11 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'path' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx11 on combined_tbl (p1);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx12 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'polygon' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx12 on combined_tbl (p2);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx13 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'txid_snapshot' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE index idx13 on combined_tbl (id1);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx14 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'bit' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx14 on combined_tbl (bitt);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx15 ON combined_tbl", - "Reason": "Indexes on columns with complex data types like 'varbit' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx15 on combined_tbl (bittv);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, { "IssueType": "migration_caveats", "ObjectType": "TABLE", @@ -420,39 +255,6 @@ "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#unsupported-datatypes-by-voyager-during-live-migration", "MinimumVersionsFixedIn": null }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx_udt ON test_udt", - "Reason": "Indexes on columns with complex data types like 'user_defined_type' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx_udt on test_udt(home_address);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx_udt1 ON test_udt", - "Reason": "Indexes on columns with complex data types like 'user_defined_type' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx_udt1 on test_udt(home_address1);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx\u0026_enum2 ON test_udt", - "Reason": "Indexes on columns with complex data types like 'user_defined_type' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX \"idx\u0026_enum2\" on test_udt((some_field::non_public.enum_test));", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, { "IssueType": "unsupported_features", "ObjectType": "INDEX", @@ -876,72 +678,6 @@ "GH": "https://github.com/yugabyte/yugabyte-db/issues/10273", "MinimumVersionsFixedIn": null }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx1 ON combined_tbl1", - "Reason": "Indexes on columns with complex data types like 'daterange' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx1 on combined_tbl1 (d);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx2 ON combined_tbl1", - "Reason": "Indexes on columns with complex data types like 'tsrange' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx2 on combined_tbl1 (t);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx3 ON combined_tbl1", - "Reason": "Indexes on columns with complex data types like 'tstzrange' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx3 on combined_tbl1 (tz);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx4 ON combined_tbl1", - "Reason": "Indexes on columns with complex data types like 'numrange' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx4 on combined_tbl1 (n);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx5 ON combined_tbl1", - "Reason": "Indexes on columns with complex data types like 'int4range' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx5 on combined_tbl1 (i4);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx6 ON combined_tbl1", - "Reason": "Indexes on columns with complex data types like 'int8range' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx6 on combined_tbl1 (i8);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, { "IssueType": "unsupported_features", "ObjectType": "TABLE", @@ -1021,32 +757,10 @@ }, { "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx7 ON combined_tbl1", - "Reason": "Indexes on columns with complex data types like 'interval' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx7 on combined_tbl1 (inym);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "INDEX", - "ObjectName": "idx8 ON combined_tbl1", - "Reason": "Indexes on columns with complex data types like 'interval' are not yet supported in YugabyteDB.", - "SqlStatement": "CREATE INDEX idx8 on combined_tbl1 (inds);", - "Suggestion": "Refer to the docs link for the workaround", - "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", - "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", - "MinimumVersionsFixedIn": null - }, - { - "IssueType": "unsupported_features", - "ObjectType": "TABLE", - "ObjectName": "test_interval, constraint: (test_interval_frequency_pkey)", - "Reason": "Primary key and Unique constraints on columns with complex data types like 'interval' are not yet supported in YugabyteDB.", - "SqlStatement": "create table test_interval(\n frequency interval primary key,\n\tcol1 int\n);", + "ObjectType": "TABLE", + "ObjectName": "test_interval, constraint: (test_interval_frequency_pkey)", + "Reason": "Primary key and Unique constraints on columns with complex data types like 'interval' are not yet supported in YugabyteDB.", + "SqlStatement": "create table test_interval(\n frequency interval primary key,\n\tcol1 int\n);", "Suggestion": "Refer to the docs link for the workaround", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", @@ -1140,7 +854,7 @@ "IssueType": "unsupported_features", "ObjectType": "INDEX", "ObjectName": "tsvector_idx ON public.documents", - "Reason": "Indexes on columns with complex data types like 'tsvector' are not yet supported in YugabyteDB.", + "Reason": "Indexes on columns with tsvector data type are not yet supported in YugabyteDB.", "SqlStatement": "CREATE INDEX tsvector_idx ON public.documents (title_tsvector, id);", "Suggestion": "Refer to the docs link for the workaround", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", @@ -1151,7 +865,7 @@ "IssueType": "unsupported_features", "ObjectType": "INDEX", "ObjectName": "tsquery_idx ON public.ts_query_table", - "Reason": "Indexes on columns with complex data types like 'tsquery' are not yet supported in YugabyteDB.", + "Reason": "Indexes on columns with tsquery data type are not yet supported in YugabyteDB.", "SqlStatement": "CREATE INDEX tsquery_idx ON public.ts_query_table (query);", "Suggestion": "Refer to the docs link for the workaround", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", @@ -1162,7 +876,7 @@ "IssueType": "unsupported_features", "ObjectType": "INDEX", "ObjectName": "idx_citext ON public.citext_type", - "Reason": "Indexes on columns with complex data types like 'citext' are not yet supported in YugabyteDB.", + "Reason": "Indexes on columns with citext data type are not yet supported in YugabyteDB.", "SqlStatement": "CREATE INDEX idx_citext ON public.citext_type USING btree (data);", "Suggestion": "Refer to the docs link for the workaround", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", @@ -1173,7 +887,7 @@ "IssueType": "unsupported_features", "ObjectType": "INDEX", "ObjectName": "idx_inet ON public.inet_type", - "Reason": "Indexes on columns with complex data types like 'inet' are not yet supported in YugabyteDB.", + "Reason": "Indexes on columns with inet data type are not yet supported in YugabyteDB.", "SqlStatement": "CREATE INDEX idx_inet ON public.inet_type USING btree (data);", "Suggestion": "Refer to the docs link for the workaround", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", @@ -1184,7 +898,7 @@ "IssueType": "unsupported_features", "ObjectType": "INDEX", "ObjectName": "idx_json ON public.test_jsonb", - "Reason": "Indexes on columns with complex data types like 'jsonb' are not yet supported in YugabyteDB.", + "Reason": "Indexes on columns with jsonb data type are not yet supported in YugabyteDB.", "SqlStatement": "CREATE INDEX idx_json ON public.test_jsonb (data);", "Suggestion": "Refer to the docs link for the workaround", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", @@ -1193,9 +907,9 @@ }, { "IssueType": "unsupported_features", - "ObjectType":"INDEX", + "ObjectType": "INDEX", "ObjectName": "idx_json2 ON public.test_jsonb", - "Reason": "Indexes on columns with complex data types like 'jsonb' are not yet supported in YugabyteDB.", + "Reason": "Indexes on columns with jsonb data type are not yet supported in YugabyteDB.", "SqlStatement": "CREATE INDEX idx_json2 ON public.test_jsonb ((data2::jsonb));", "Suggestion": "Refer to the docs link for the workaround", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", @@ -1206,13 +920,299 @@ "IssueType": "unsupported_features", "ObjectType": "INDEX", "ObjectName": "idx_array ON public.documents", - "Reason": "Indexes on columns with complex data types like 'array' are not yet supported in YugabyteDB.", + "Reason": "Indexes on columns with array data type are not yet supported in YugabyteDB.", "SqlStatement": "create index idx_array on public.documents (list_of_sections);", "Suggestion": "Refer to the docs link for the workaround", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", "MinimumVersionsFixedIn": null }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx1 ON combined_tbl", + "Reason": "Indexes on columns with cidr data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx1 on combined_tbl (c);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx2 ON combined_tbl", + "Reason": "Indexes on columns with circle data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx2 on combined_tbl (ci);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx3 ON combined_tbl", + "Reason": "Indexes on columns with box data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx3 on combined_tbl (b);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx4 ON combined_tbl", + "Reason": "Indexes on columns with json data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx4 on combined_tbl (j);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx5 ON combined_tbl", + "Reason": "Indexes on columns with line data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx5 on combined_tbl (l);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx6 ON combined_tbl", + "Reason": "Indexes on columns with lseg data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx6 on combined_tbl (ls);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx7 ON combined_tbl", + "Reason": "Indexes on columns with macaddr data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx7 on combined_tbl (maddr);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx8 ON combined_tbl", + "Reason": "Indexes on columns with macaddr8 data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx8 on combined_tbl (maddr8);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx9 ON combined_tbl", + "Reason": "Indexes on columns with point data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx9 on combined_tbl (p);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx10 ON combined_tbl", + "Reason": "Indexes on columns with pg_lsn data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx10 on combined_tbl (lsn);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx11 ON combined_tbl", + "Reason": "Indexes on columns with path data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx11 on combined_tbl (p1);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx12 ON combined_tbl", + "Reason": "Indexes on columns with polygon data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx12 on combined_tbl (p2);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx13 ON combined_tbl", + "Reason": "Indexes on columns with txid_snapshot data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE index idx13 on combined_tbl (id1);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx14 ON combined_tbl", + "Reason": "Indexes on columns with bit data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx14 on combined_tbl (bitt);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx15 ON combined_tbl", + "Reason": "Indexes on columns with varbit data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx15 on combined_tbl (bittv);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx1 ON combined_tbl1", + "Reason": "Indexes on columns with daterange data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx1 on combined_tbl1 (d);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx2 ON combined_tbl1", + "Reason": "Indexes on columns with tsrange data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx2 on combined_tbl1 (t);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx3 ON combined_tbl1", + "Reason": "Indexes on columns with tstzrange data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx3 on combined_tbl1 (tz);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx4 ON combined_tbl1", + "Reason": "Indexes on columns with numrange data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx4 on combined_tbl1 (n);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx5 ON combined_tbl1", + "Reason": "Indexes on columns with int4range data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx5 on combined_tbl1 (i4);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx6 ON combined_tbl1", + "Reason": "Indexes on columns with int8range data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx6 on combined_tbl1 (i8);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx7 ON combined_tbl1", + "Reason": "Indexes on columns with interval data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx7 on combined_tbl1 (inym);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx8 ON combined_tbl1", + "Reason": "Indexes on columns with interval data type are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx8 on combined_tbl1 (inds);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx_udt ON test_udt", + "Reason": "Indexes on columns with user defined data types are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx_udt on test_udt(home_address);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx_udt1 ON test_udt", + "Reason": "Indexes on columns with user defined data types are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX idx_udt1 on test_udt(home_address1);", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, + { + "IssueType": "unsupported_features", + "ObjectType": "INDEX", + "ObjectName": "idx\u0026_enum2 ON test_udt", + "Reason": "Indexes on columns with user defined data types are not yet supported in YugabyteDB.", + "SqlStatement": "CREATE INDEX \"idx\u0026_enum2\" on test_udt((some_field::non_public.enum_test));", + "Suggestion": "Refer to the docs link for the workaround", + "GH": "https://github.com/yugabyte/yugabyte-db/issues/25003", + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", + "MinimumVersionsFixedIn": null + }, { "IssueType": "unsupported_features", "ObjectType": "TABLE", diff --git a/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json b/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json index d4fb407cf7..eb3b612521 100644 --- a/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json +++ b/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json @@ -453,9 +453,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'citext' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_CITEXT_DATATYPE", + "Name": "Index on column with citext datatype", + "Description": "Indexes on columns with citext data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx_citext ON public.citext_type", @@ -466,9 +466,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'tsvector' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_TSVECTOR_DATATYPE", + "Name": "Index on column with tsvector datatype", + "Description": "Indexes on columns with tsvector data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "tsvector_idx ON public.documents", @@ -479,9 +479,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'tsquery' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_TSQUERY_DATATYPE", + "Name": "Index on column with tsquery datatype", + "Description": "Indexes on columns with tsquery data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "tsquery_idx ON public.ts_query_table", @@ -492,9 +492,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'jsonb' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_JSONB_DATATYPE", + "Name": "Index on column with jsonb datatype", + "Description": "Indexes on columns with jsonb data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx_json ON public.test_jsonb", @@ -505,9 +505,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'jsonb' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_JSONB_DATATYPE", + "Name": "Index on column with jsonb datatype", + "Description": "Indexes on columns with jsonb data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx_json2 ON public.test_jsonb", @@ -518,9 +518,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'inet' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_INET_DATATYPE", + "Name": "Index on column with inet datatype", + "Description": "Indexes on columns with inet data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx_inet ON public.inet_type", @@ -531,9 +531,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'macaddr' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_MACADDR_DATATYPE", + "Name": "Index on column with macaddr datatype", + "Description": "Indexes on columns with macaddr data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx2 ON public.combined_tbl", @@ -544,9 +544,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'macaddr8' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_MACADDR8_DATATYPE", + "Name": "Index on column with macaddr8 datatype", + "Description": "Indexes on columns with macaddr8 data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx3 ON public.combined_tbl", @@ -557,9 +557,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'cidr' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_CIDR_DATATYPE", + "Name": "Index on column with cidr datatype", + "Description": "Indexes on columns with cidr data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx1 ON public.combined_tbl", @@ -570,9 +570,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'bit' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_BIT_DATATYPE", + "Name": "Index on column with bit datatype", + "Description": "Indexes on columns with bit data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx5 ON public.combined_tbl", @@ -583,9 +583,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'varbit' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_VARBIT_DATATYPE", + "Name": "Index on column with varbit datatype", + "Description": "Indexes on columns with varbit data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx6 ON public.combined_tbl", @@ -596,9 +596,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'daterange' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_DATERANGE_DATATYPE", + "Name": "Index on column with daterange datatype", + "Description": "Indexes on columns with daterange data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx8 ON public.combined_tbl", @@ -609,9 +609,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'interval' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_INTERVAL_DATATYPE", + "Name": "Index on column with interval datatype", + "Description": "Indexes on columns with interval data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx9 ON public.combined_tbl", @@ -622,9 +622,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'pg_lsn' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_PG_LSN_DATATYPE", + "Name": "Index on column with pg_lsn datatype", + "Description": "Indexes on columns with pg_lsn data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx4 ON public.combined_tbl", @@ -635,9 +635,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'array' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_ARRAY_DATATYPE", + "Name": "Index on column with array datatype", + "Description": "Indexes on columns with array data type are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx_array ON public.documents", @@ -648,9 +648,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'user_defined_type' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_USER_DEFINED_DATATYPE", + "Name": "Index on column with user defined datatype", + "Description": "Indexes on columns with user defined data types are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx7 ON public.combined_tbl", @@ -4793,4 +4793,4 @@ "Limitations in assessment", "There are some Unlogged tables in the schema. They will be created as regular LOGGED tables in YugabyteDB as unlogged tables are not supported." ] -} \ No newline at end of file +} diff --git a/migtests/tests/pg/omnibus/expected_files/expectedAssessmentReport.json b/migtests/tests/pg/omnibus/expected_files/expectedAssessmentReport.json index ee1dfbbb8f..fe3fddafca 100755 --- a/migtests/tests/pg/omnibus/expected_files/expectedAssessmentReport.json +++ b/migtests/tests/pg/omnibus/expected_files/expectedAssessmentReport.json @@ -655,9 +655,9 @@ { "Category": "unsupported_features", "CategoryDescription": "Features of the source database that are not supported on the target YugabyteDB.", - "Type": "INDEX_ON_COMPLEX_DATATYPE", - "Name": "Index on column with complex datatype", - "Description": "Indexes on columns with complex data types like 'user_defined_type' are not yet supported in YugabyteDB. Refer to the docs link for the workaround", + "Type": "INDEX_ON_USER_DEFINED_DATATYPE", + "Name": "Index on column with user defined datatype", + "Description": "Indexes on columns with user defined data types are not yet supported in YugabyteDB. Refer to the docs link for the workaround", "Impact": "LEVEL_1", "ObjectType": "INDEX", "ObjectName": "idx_1 ON composite_type_examples.ordinary_table", diff --git a/migtests/tests/pg/omnibus/expected_files/expected_schema_analysis_report.json b/migtests/tests/pg/omnibus/expected_files/expected_schema_analysis_report.json index e6ffd9ee94..3bc52fca17 100755 --- a/migtests/tests/pg/omnibus/expected_files/expected_schema_analysis_report.json +++ b/migtests/tests/pg/omnibus/expected_files/expected_schema_analysis_report.json @@ -232,7 +232,7 @@ "IssueType": "unsupported_features", "ObjectType": "INDEX", "ObjectName": "idx_1 ON composite_type_examples.ordinary_table", - "Reason": "Indexes on columns with complex data types like 'user_defined_type' are not yet supported in YugabyteDB.", + "Reason": "Indexes on columns with user defined data types are not yet supported in YugabyteDB.", "SqlStatement": "CREATE INDEX idx_1 ON composite_type_examples.ordinary_table USING btree (basic_);", "FilePath": "/home/ubuntu/yb-voyager/migtests/tests/pg/omnibus/export-dir/schema/tables/INDEXES_table.sql", "Suggestion": "Refer to the docs link for the workaround", diff --git a/yb-voyager/cmd/assessMigrationCommand.go b/yb-voyager/cmd/assessMigrationCommand.go index 7e1bf706b4..7c0b7c4cca 100644 --- a/yb-voyager/cmd/assessMigrationCommand.go +++ b/yb-voyager/cmd/assessMigrationCommand.go @@ -1001,7 +1001,7 @@ func fetchUnsupportedPGFeaturesFromSchemaReport(schemaAnalysisReport utils.Schem unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(EXCLUSION_CONSTRAINT_FEATURE, "", queryissue.EXCLUSION_CONSTRAINTS, schemaAnalysisReport, false)) unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(DEFERRABLE_CONSTRAINT_FEATURE, "", queryissue.DEFERRABLE_CONSTRAINTS, schemaAnalysisReport, false)) unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(VIEW_CHECK_FEATURE, "", VIEW_WITH_CHECK_OPTION_ISSUE_TYPE, schemaAnalysisReport, false)) - unsupportedFeatures = append(unsupportedFeatures, getIndexesOnComplexTypeUnsupportedFeature(schemaAnalysisReport, queryissue.UnsupportedIndexDatatypes)) + unsupportedFeatures = append(unsupportedFeatures, getIndexesOnComplexTypeUnsupportedFeature(schemaAnalysisReport, queryissue.UnsupportedIndexDatatypes)...) unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(PK_UK_CONSTRAINT_ON_COMPLEX_DATATYPES_FEATURE, "", queryissue.PK_UK_ON_COMPLEX_DATATYPE, schemaAnalysisReport, false)) unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(UNLOGGED_TABLE_FEATURE, "", queryissue.UNLOGGED_TABLES, schemaAnalysisReport, false)) unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(REFERENCING_TRIGGER_FEATURE, "", queryissue.REFERENCING_CLAUSE_IN_TRIGGER, schemaAnalysisReport, false)) @@ -1033,27 +1033,43 @@ func fetchUnsupportedPGFeaturesFromSchemaReport(schemaAnalysisReport utils.Schem }), nil } -func getIndexesOnComplexTypeUnsupportedFeature(schemaAnalysisReport utils.SchemaReport, unsupportedIndexDatatypes []string) UnsupportedFeature { +func getIndexesOnComplexTypeUnsupportedFeature(schemaAnalysisReport utils.SchemaReport, unsupportedIndexDatatypes []string) []UnsupportedFeature { // TODO: include MinimumVersionsFixedIn - indexesOnComplexTypesFeature := UnsupportedFeature{ - FeatureName: "Index on complex datatypes", - DisplayDDL: false, - Objects: []ObjectInfo{}, - } - unsupportedIndexDatatypes = append(unsupportedIndexDatatypes, "array") // adding it here only as we know issue form analyze will come with type - unsupportedIndexDatatypes = append(unsupportedIndexDatatypes, "user_defined_type") // adding it here as we UDTs will come with this type. - for _, unsupportedType := range unsupportedIndexDatatypes { - indexes := getUnsupportedFeaturesFromSchemaAnalysisReport(fmt.Sprintf("%s indexes", unsupportedType), fmt.Sprintf(queryissue.INDEX_ON_COMPLEX_DATATYPE_ISSUE_DESCRIPTION, unsupportedType), "", schemaAnalysisReport, false) - for _, object := range indexes.Objects { - formattedObject := object - formattedObject.ObjectName = fmt.Sprintf("%s: %s", strings.ToUpper(unsupportedType), object.ObjectName) - indexesOnComplexTypesFeature.Objects = append(indexesOnComplexTypesFeature.Objects, formattedObject) - if indexesOnComplexTypesFeature.DocsLink == "" { - indexesOnComplexTypesFeature.DocsLink = indexes.DocsLink - } - } - } - return indexesOnComplexTypesFeature + log.Infof("fetching unsupported features for Index on complex datatypes...") + unsupportedFeatures := make([]UnsupportedFeature, 0) + + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_CITEXT_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_CITEXT_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_TSVECTOR_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_TSVECTOR_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_TSQUERY_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_TSQUERY_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_JSONB_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_JSONB_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_INET_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_INET_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_JSON_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_JSON_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_MACADDR_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_MACADDR_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_MACADDR8_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_MACADDR8_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_CIDR_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_CIDR_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_BIT_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_BIT_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_VARBIT_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_VARBIT_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_DATERANGE_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_DATERANGE_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_TSRANGE_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_TSRANGE_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_TSTZRANGE_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_TSTZRANGE_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_NUMRANGE_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_NUMRANGE_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_INT4RANGE_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_INT4RANGE_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_INT8RANGE_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_INT8RANGE_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_INTERVAL_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_INTERVAL_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_CIRCLE_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_CIRCLE_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_BOX_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_BOX_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_LINE_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_LINE_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_LSEG_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_LSEG_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_POINT_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_POINT_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_PG_LSN_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_PG_LSN_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_PATH_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_PATH_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_POLYGON_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_POLYGON_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_TXID_SNAPSHOT_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_TXID_SNAPSHOT_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_ARRAY_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_ARRAY_DATATYPE, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.INDEX_ON_USER_DEFINED_DATATYPE_ISSUE_NAME, "", queryissue.INDEX_ON_USER_DEFINED_DATATYPE, schemaAnalysisReport, false)) + return lo.Filter(unsupportedFeatures, func(f UnsupportedFeature, _ int) bool { + return len(f.Objects) > 0 + }) } func fetchUnsupportedOracleFeaturesFromSchemaReport(schemaAnalysisReport utils.SchemaReport) ([]UnsupportedFeature, error) { diff --git a/yb-voyager/src/query/queryissue/constants.go b/yb-voyager/src/query/queryissue/constants.go index 7681f18d6c..de5eb04b3b 100644 --- a/yb-voyager/src/query/queryissue/constants.go +++ b/yb-voyager/src/query/queryissue/constants.go @@ -45,9 +45,39 @@ const ( UNSUPPORTED_DATATYPE_LIVE_MIGRATION = "UNSUPPORTED_DATATYPE_LIVE_MIGRATION" UNSUPPORTED_DATATYPE_LIVE_MIGRATION_WITH_FF_FB = "UNSUPPORTED_DATATYPE_LIVE_MIGRATION_WITH_FF_FB" PK_UK_ON_COMPLEX_DATATYPE = "PK_UK_ON_COMPLEX_DATATYPE" - INDEX_ON_COMPLEX_DATATYPE = "INDEX_ON_COMPLEX_DATATYPE" - FOREIGN_TABLE = "FOREIGN_TABLE" - INHERITANCE = "INHERITANCE" + + INDEX_ON_CITEXT_DATATYPE = "INDEX_ON_CITEXT_DATATYPE" + INDEX_ON_TSVECTOR_DATATYPE = "INDEX_ON_TSVECTOR_DATATYPE" + INDEX_ON_TSQUERY_DATATYPE = "INDEX_ON_TSQUERY_DATATYPE" + INDEX_ON_JSONB_DATATYPE = "INDEX_ON_JSONB_DATATYPE" + INDEX_ON_INET_DATATYPE = "INDEX_ON_INET_DATATYPE" + INDEX_ON_JSON_DATATYPE = "INDEX_ON_JSON_DATATYPE" + INDEX_ON_MACADDR_DATATYPE = "INDEX_ON_MACADDR_DATATYPE" + INDEX_ON_MACADDR8_DATATYPE = "INDEX_ON_MACADDR8_DATATYPE" + INDEX_ON_CIDR_DATATYPE = "INDEX_ON_CIDR_DATATYPE" + INDEX_ON_BIT_DATATYPE = "INDEX_ON_BIT_DATATYPE" + INDEX_ON_VARBIT_DATATYPE = "INDEX_ON_VARBIT_DATATYPE" + INDEX_ON_DATERANGE_DATATYPE = "INDEX_ON_DATERANGE_DATATYPE" + INDEX_ON_TSRANGE_DATATYPE = "INDEX_ON_TSRANGE_DATATYPE" + INDEX_ON_TSTZRANGE_DATATYPE = "INDEX_ON_TSTZRANGE_DATATYPE" + INDEX_ON_NUMRANGE_DATATYPE = "INDEX_ON_NUMRANGE_DATATYPE" + INDEX_ON_INT4RANGE_DATATYPE = "INDEX_ON_INT4RANGE_DATATYPE" + INDEX_ON_INT8RANGE_DATATYPE = "INDEX_ON_INT8RANGE_DATATYPE" + INDEX_ON_INTERVAL_DATATYPE = "INDEX_ON_INTERVAL_DATATYPE" + INDEX_ON_CIRCLE_DATATYPE = "INDEX_ON_CIRCLE_DATATYPE" + INDEX_ON_BOX_DATATYPE = "INDEX_ON_BOX_DATATYPE" + INDEX_ON_LINE_DATATYPE = "INDEX_ON_LINE_DATATYPE" + INDEX_ON_LSEG_DATATYPE = "INDEX_ON_LSEG_DATATYPE" + INDEX_ON_POINT_DATATYPE = "INDEX_ON_POINT_DATATYPE" + INDEX_ON_PG_LSN_DATATYPE = "INDEX_ON_PG_LSN_DATATYPE" + INDEX_ON_PATH_DATATYPE = "INDEX_ON_PATH_DATATYPE" + INDEX_ON_POLYGON_DATATYPE = "INDEX_ON_POLYGON_DATATYPE" + INDEX_ON_TXID_SNAPSHOT_DATATYPE = "INDEX_ON_TXID_SNAPSHOT_DATATYPE" + INDEX_ON_ARRAY_DATATYPE = "INDEX_ON_ARRAY_DATATYPE" + INDEX_ON_USER_DEFINED_DATATYPE = "INDEX_ON_USER_DEFINED_DATATYPE" + + FOREIGN_TABLE = "FOREIGN_TABLE" + INHERITANCE = "INHERITANCE" ANY_VALUE_AGGREGATE_FUNCTION = "ANY_VALUE_AGGREGATE_FUNCTION" ANY_VALUE_AGGREGATE_FUNCTION_NAME = "ANY_VALUE() aggregate Function" @@ -115,7 +145,36 @@ const ( const ( // Issue Names - INDEX_ON_COMPLEX_DATATYPE_ISSUE_NAME = "Index on column with complex datatype" + INDEX_ON_CITEXT_DATATYPE_ISSUE_NAME = "Index on column with citext datatype" + INDEX_ON_TSVECTOR_DATATYPE_ISSUE_NAME = "Index on column with tsvector datatype" + INDEX_ON_TSQUERY_DATATYPE_ISSUE_NAME = "Index on column with tsquery datatype" + INDEX_ON_JSONB_DATATYPE_ISSUE_NAME = "Index on column with jsonb datatype" + INDEX_ON_INET_DATATYPE_ISSUE_NAME = "Index on column with inet datatype" + INDEX_ON_JSON_DATATYPE_ISSUE_NAME = "Index on column with json datatype" + INDEX_ON_MACADDR_DATATYPE_ISSUE_NAME = "Index on column with macaddr datatype" + INDEX_ON_MACADDR8_DATATYPE_ISSUE_NAME = "Index on column with macaddr8 datatype" + INDEX_ON_CIDR_DATATYPE_ISSUE_NAME = "Index on column with cidr datatype" + INDEX_ON_BIT_DATATYPE_ISSUE_NAME = "Index on column with bit datatype" + INDEX_ON_VARBIT_DATATYPE_ISSUE_NAME = "Index on column with varbit datatype" + INDEX_ON_DATERANGE_DATATYPE_ISSUE_NAME = "Index on column with daterange datatype" + INDEX_ON_TSRANGE_DATATYPE_ISSUE_NAME = "Index on column with tsrange datatype" + INDEX_ON_TSTZRANGE_DATATYPE_ISSUE_NAME = "Index on column with tstzrange datatype" + INDEX_ON_NUMRANGE_DATATYPE_ISSUE_NAME = "Index on column with numrange datatype" + INDEX_ON_INT4RANGE_DATATYPE_ISSUE_NAME = "Index on column with int4range datatype" + INDEX_ON_INT8RANGE_DATATYPE_ISSUE_NAME = "Index on column with int8range datatype" + INDEX_ON_INTERVAL_DATATYPE_ISSUE_NAME = "Index on column with interval datatype" + INDEX_ON_CIRCLE_DATATYPE_ISSUE_NAME = "Index on column with circle datatype" + INDEX_ON_BOX_DATATYPE_ISSUE_NAME = "Index on column with box datatype" + INDEX_ON_LINE_DATATYPE_ISSUE_NAME = "Index on column with line datatype" + INDEX_ON_LSEG_DATATYPE_ISSUE_NAME = "Index on column with lseg datatype" + INDEX_ON_POINT_DATATYPE_ISSUE_NAME = "Index on column with point datatype" + INDEX_ON_PG_LSN_DATATYPE_ISSUE_NAME = "Index on column with pg_lsn datatype" + INDEX_ON_PATH_DATATYPE_ISSUE_NAME = "Index on column with path datatype" + INDEX_ON_POLYGON_DATATYPE_ISSUE_NAME = "Index on column with polygon datatype" + INDEX_ON_TXID_SNAPSHOT_DATATYPE_ISSUE_NAME = "Index on column with txid_snapshot datatype" + INDEX_ON_ARRAY_DATATYPE_ISSUE_NAME = "Index on column with array datatype" + INDEX_ON_USER_DEFINED_DATATYPE_ISSUE_NAME = "Index on column with user defined datatype" + UNSUPPORTED_INDEX_METHOD_ISSUE_NAME = "Index with access method" PK_UK_ON_COMPLEX_DATATYPE_ISSUE_NAME = "Primary/Unique key on column with complex datatype" UNSUPPORTED_DATATYPE_LIVE_MIGRATION_ISSUE_NAME = "Unsupported datatype for Live migration" @@ -172,18 +231,48 @@ const ( UNSUPPORTED_DATATYPE_LIVE_MIGRATION_ISSUE_DESCRIPTION = "Datatype not yet supported by voyager in live migration. Affected column: %s and type: %v. These columns will be excluded when exporting and importing data in live migration workflows." UNSUPPORTED_DATATYPE_LIVE_MIGRATION_WITH_FF_FB_ISSUE_DESCRIPTION = "Datatype not yet supported by voyager in live migration with fall-forward/fallback. Affected column: %s and type: %v. These columns will be excluded when exporting and importing data in live migration workflows." PK_UK_ON_COMPLEX_DATATYPE_ISSUE_DESCRIPTION = "Primary key and Unique constraints on columns with complex data types like '%v' are not yet supported in YugabyteDB." - INDEX_ON_COMPLEX_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with complex data types like '%v' are not yet supported in YugabyteDB." - FOREIGN_TABLE_ISSUE_DESCRIPTION = "Foreign table creation fails as SERVER and USER MAPPING objects are not exported by voyager." - INHERITANCE_ISSUE_DESCRIPTION = "Table inheritance is not yet supported in YugabyteDB." - REFERENCED_TYPE_DECLARATION_ISSUE_DESCRIPTION = "Referencing the type of a column instead of the actual type name is not supported in YugabyteDB." - LARGE_OBJECT_DATATYPE_ISSUE_DESCRIPTION = "Large Objects are not yet supported in YugabyteDB. Affected column: %s." - MULTI_RANGE_DATATYPE_ISSUE_DESCRIPTION = "Multi-range data type is not yet supported in YugabyteDB. Affected column: %s and type: %v." - SECURITY_INVOKER_VIEWS_ISSUE_DESCRIPTION = "Security invoker views are not yet supported in YugabyteDB." - DETERMINISTIC_OPTION_WITH_COLLATION_ISSUE_DESCRIPTION = "Deterministic option/attribute with collation is not yet supported in YugabyteDB." - NON_DETERMINISTIC_COLLATION_ISSUE_DESCRIPTION = "Non-Deterministic collations are not yet supported in YugabyteDB." - FOREIGN_KEY_REFERENCES_PARTITIONED_TABLE_ISSUE_DESCRIPTION = "Foreign key references to partitioned table are not yet supported in YugabyteDB." - UNIQUE_NULLS_NOT_DISTINCT_ISSUE_DESCRIPTION = "Unique constraint on columns with NULL values is not yet supported in YugabyteDB." DATABASE_OPTIONS_DESCRIPTION = "Database options (%s) introduced in PostgreSQL 12 and later are not supported yet in YugabyteDB." + + INDEX_ON_CITEXT_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with citext data type are not yet supported in YugabyteDB." + INDEX_ON_TSVECTOR_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with tsvector data type are not yet supported in YugabyteDB." + INDEX_ON_TSQUERY_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with tsquery data type are not yet supported in YugabyteDB." + INDEX_ON_JSONB_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with jsonb data type are not yet supported in YugabyteDB." + INDEX_ON_INET_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with inet data type are not yet supported in YugabyteDB." + INDEX_ON_JSON_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with json data type are not yet supported in YugabyteDB." + INDEX_ON_MACADDR_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with macaddr data type are not yet supported in YugabyteDB." + INDEX_ON_MACADDR8_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with macaddr8 data type are not yet supported in YugabyteDB." + INDEX_ON_CIDR_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with cidr data type are not yet supported in YugabyteDB." + INDEX_ON_BIT_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with bit data type are not yet supported in YugabyteDB." + INDEX_ON_VARBIT_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with varbit data type are not yet supported in YugabyteDB." + INDEX_ON_DATERANGE_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with daterange data type are not yet supported in YugabyteDB." + INDEX_ON_TSRANGE_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with tsrange data type are not yet supported in YugabyteDB." + INDEX_ON_TSTZRANGE_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with tstzrange data type are not yet supported in YugabyteDB." + INDEX_ON_NUMRANGE_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with numrange data type are not yet supported in YugabyteDB." + INDEX_ON_INT4RANGE_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with int4range data type are not yet supported in YugabyteDB." + INDEX_ON_INT8RANGE_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with int8range data type are not yet supported in YugabyteDB." + INDEX_ON_INTERVAL_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with interval data type are not yet supported in YugabyteDB." + INDEX_ON_CIRCLE_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with circle data type are not yet supported in YugabyteDB." + INDEX_ON_BOX_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with box data type are not yet supported in YugabyteDB." + INDEX_ON_LINE_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with line data type are not yet supported in YugabyteDB." + INDEX_ON_LSEG_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with lseg data type are not yet supported in YugabyteDB." + INDEX_ON_POINT_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with point data type are not yet supported in YugabyteDB." + INDEX_ON_PG_LSN_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with pg_lsn data type are not yet supported in YugabyteDB." + INDEX_ON_PATH_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with path data type are not yet supported in YugabyteDB." + INDEX_ON_POLYGON_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with polygon data type are not yet supported in YugabyteDB." + INDEX_ON_TXID_SNAPSHOT_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with txid_snapshot data type are not yet supported in YugabyteDB." + INDEX_ON_ARRAY_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with array data type are not yet supported in YugabyteDB." + INDEX_ON_USER_DEFINED_DATATYPE_ISSUE_DESCRIPTION = "Indexes on columns with user defined data types are not yet supported in YugabyteDB." + + FOREIGN_TABLE_ISSUE_DESCRIPTION = "Foreign table creation fails as SERVER and USER MAPPING objects are not exported by voyager." + INHERITANCE_ISSUE_DESCRIPTION = "Table inheritance is not yet supported in YugabyteDB." + REFERENCED_TYPE_DECLARATION_ISSUE_DESCRIPTION = "Referencing the type of a column instead of the actual type name is not supported in YugabyteDB." + LARGE_OBJECT_DATATYPE_ISSUE_DESCRIPTION = "Large Objects are not yet supported in YugabyteDB. Affected column: %s." + MULTI_RANGE_DATATYPE_ISSUE_DESCRIPTION = "Multi-range data type is not yet supported in YugabyteDB. Affected column: %s and type: %v." + SECURITY_INVOKER_VIEWS_ISSUE_DESCRIPTION = "Security invoker views are not yet supported in YugabyteDB." + DETERMINISTIC_OPTION_WITH_COLLATION_ISSUE_DESCRIPTION = "Deterministic option/attribute with collation is not yet supported in YugabyteDB." + NON_DETERMINISTIC_COLLATION_ISSUE_DESCRIPTION = "Non-Deterministic collations are not yet supported in YugabyteDB." + FOREIGN_KEY_REFERENCES_PARTITIONED_TABLE_ISSUE_DESCRIPTION = "Foreign key references to partitioned table are not yet supported in YugabyteDB." + UNIQUE_NULLS_NOT_DISTINCT_ISSUE_DESCRIPTION = "Unique constraint on columns with NULL values is not yet supported in YugabyteDB." ) // Object types @@ -219,7 +308,9 @@ const ( XML_DATATYPE_ISSUE_SUGGESTION = "Data ingestion is not supported for this type in YugabyteDB so handle this type in different way. Refer link for more details." XID_DATATYPE_ISSUE_SUGGESTION = "Functions for this type e.g. txid_current are not supported in YugabyteDB yet" PK_UK_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION = "Refer to the docs link for the workaround" - INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION = "Refer to the docs link for the workaround" - FOREIGN_TABLE_ISSUE_SUGGESTION = "SERVER '%s', and USER MAPPING should be created manually on the target to create and use the foreign table" - REFERENCED_TYPE_DECLARATION_ISSUE_SUGGESTION = "Fix the syntax to include the actual type name instead of referencing the type of a column" + + INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION = "Refer to the docs link for the workaround" + + FOREIGN_TABLE_ISSUE_SUGGESTION = "SERVER '%s', and USER MAPPING should be created manually on the target to create and use the foreign table" + REFERENCED_TYPE_DECLARATION_ISSUE_SUGGESTION = "Fix the syntax to include the actual type name instead of referencing the type of a column" ) diff --git a/yb-voyager/src/query/queryissue/detectors_ddl.go b/yb-voyager/src/query/queryissue/detectors_ddl.go index 2ecab6a243..b1d7cffed2 100644 --- a/yb-voyager/src/query/queryissue/detectors_ddl.go +++ b/yb-voyager/src/query/queryissue/detectors_ddl.go @@ -374,35 +374,33 @@ func (d *IndexIssueDetector) DetectIssues(obj queryparser.DDLObject) ([]QueryIss isUnsupportedType := slices.Contains(UnsupportedIndexDatatypes, param.ExprCastTypeName) isUDTType := slices.Contains(d.compositeTypes, param.GetFullExprCastTypeName()) if param.IsExprCastArrayType { - issues = append(issues, NewIndexOnComplexDatatypesIssue( + issues = append(issues, NewIndexOnArrayDatatypeIssue( obj.GetObjectType(), index.GetObjectName(), "", - "array", )) - } else if isUnsupportedType || isUDTType { - reportTypeName := param.ExprCastTypeName - if isUDTType { - reportTypeName = "user_defined_type" - } - issues = append(issues, NewIndexOnComplexDatatypesIssue( + } else if isUDTType { + issues = append(issues, NewIndexOnUserDefinedTypeIssue( obj.GetObjectType(), index.GetObjectName(), "", - reportTypeName, + )) + } else if isUnsupportedType { + issues = append(issues, reportIndexOnComplexDatatypesIssue( + obj.GetObjectType(), + index.GetObjectName(), + param.ExprCastTypeName, )) } - } else { colName := param.ColName typeName, ok := d.columnsWithUnsupportedIndexDatatypes[index.GetTableName()][colName] if !ok { continue } - issues = append(issues, NewIndexOnComplexDatatypesIssue( + issues = append(issues, reportIndexOnComplexDatatypesIssue( obj.GetObjectType(), index.GetObjectName(), - "", typeName, )) } @@ -412,6 +410,191 @@ func (d *IndexIssueDetector) DetectIssues(obj queryparser.DDLObject) ([]QueryIss return issues, nil } +func reportIndexOnComplexDatatypesIssue(objType string, objName string, typeName string) QueryIssue { + var queryIssue QueryIssue + switch typeName { + case "citext": + queryIssue = NewIndexOnCitextDatatypeIssue( + objType, + objName, + "", + ) + case "tsvector": + queryIssue = NewIndexOnTsVectorDatatypeIssue( + objType, + objName, + "", + ) + case "tsquery": + queryIssue = NewIndexOnTsQueryDatatypeIssue( + objType, + objName, + "", + ) + case "jsonb": + queryIssue = NewIndexOnJsonbDatatypeIssue( + objType, + objName, + "", + ) + case "inet": + queryIssue = NewIndexOnInetDatatypeIssue( + objType, + objName, + "", + ) + case "json": + queryIssue = NewIndexOnJsonDatatypeIssue( + objType, + objName, + "", + ) + case "macaddr": + queryIssue = NewIndexOnMacaddrDatatypeIssue( + objType, + objName, + "", + ) + case "macaddr8": + queryIssue = NewIndexOnMacaddr8DatatypeIssue( + objType, + objName, + "", + ) + case "cidr": + queryIssue = NewIndexOnCidrDatatypeIssue( + objType, + objName, + "", + ) + case "bit": + queryIssue = NewIndexOnBitDatatypeIssue( + objType, + objName, + "", + ) + case "varbit": + queryIssue = NewIndexOnVarbitDatatypeIssue( + objType, + objName, + "", + ) + case "daterange": + queryIssue = NewIndexOnDaterangeDatatypeIssue( + objType, + objName, + "", + ) + case "tsrange": + queryIssue = NewIndexOnTsrangeDatatypeIssue( + objType, + objName, + "", + ) + case "tstzrange": + queryIssue = NewIndexOnTstzrangeDatatypeIssue( + objType, + objName, + "", + ) + case "numrange": + queryIssue = NewIndexOnNumrangeDatatypeIssue( + objType, + objName, + "", + ) + case "int4range": + queryIssue = NewIndexOnInt4rangeDatatypeIssue( + objType, + objName, + "", + ) + case "int8range": + queryIssue = NewIndexOnInt8rangeDatatypeIssue( + objType, + objName, + "", + ) + case "interval": + queryIssue = NewIndexOnIntervalDatatypeIssue( + objType, + objName, + "", + ) + case "circle": + queryIssue = NewIndexOnCircleDatatypeIssue( + objType, + objName, + "", + ) + case "box": + queryIssue = NewIndexOnBoxDatatypeIssue( + objType, + objName, + "", + ) + case "line": + queryIssue = NewIndexOnLineDatatypeIssue( + objType, + objName, + "", + ) + case "lseg": + queryIssue = NewIndexOnLsegDatatypeIssue( + objType, + objName, + "", + ) + case "point": + queryIssue = NewIndexOnPointDatatypeIssue( + objType, + objName, + "", + ) + case "pg_lsn": + queryIssue = NewIndexOnPgLsnDatatypeIssue( + objType, + objName, + "", + ) + case "path": + queryIssue = NewIndexOnPathDatatypeIssue( + objType, + objName, + "", + ) + case "polygon": + queryIssue = NewIndexOnPolygonDatatypeIssue( + objType, + objName, + "", + ) + case "txid_snapshot": + queryIssue = NewIndexOnTxidSnapshotDatatypeIssue( + objType, + objName, + "", + ) + case "array": + queryIssue = NewIndexOnArrayDatatypeIssue( + objType, + objName, + "", + ) + case "user_defined_type": + queryIssue = NewIndexOnUserDefinedTypeIssue( + objType, + objName, + "", + ) + default: + // Unrecognized types + // Throwing error for now + utils.ErrExit("Unrecognized unsupported index data type %s", typeName) + } + return queryIssue +} + //=============ALTER TABLE ISSUE DETECTOR =========================== // AlterTableIssueDetector handles detection of alter table-related issues diff --git a/yb-voyager/src/query/queryissue/issues_ddl.go b/yb-voyager/src/query/queryissue/issues_ddl.go index 409d9d0768..a85c2acf7a 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl.go +++ b/yb-voyager/src/query/queryissue/issues_ddl.go @@ -437,19 +437,438 @@ func NewPrimaryOrUniqueConsOnUnsupportedIndexTypesIssue(objectType string, objec return newQueryIssue(issue, objectType, objectName, sqlStatement, details) } -var indexOnComplexDatatypesIssue = issue.Issue{ - Type: INDEX_ON_COMPLEX_DATATYPE, - Name: INDEX_ON_COMPLEX_DATATYPE_ISSUE_NAME, +var indexOnArrayDatatypeIssue = issue.Issue{ + Type: INDEX_ON_ARRAY_DATATYPE, + Name: INDEX_ON_ARRAY_DATATYPE_ISSUE_NAME, Impact: constants.IMPACT_LEVEL_1, - Description: INDEX_ON_COMPLEX_DATATYPE_ISSUE_DESCRIPTION, + Description: INDEX_ON_ARRAY_DATATYPE_ISSUE_DESCRIPTION, GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", } -func NewIndexOnComplexDatatypesIssue(objectType string, objectName string, sqlStatement string, typeName string) QueryIssue { - issue := indexOnComplexDatatypesIssue - issue.Description = fmt.Sprintf(issue.Description, typeName) +func NewIndexOnArrayDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnArrayDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnUserDefinedDatatypeIssue = issue.Issue{ + Type: INDEX_ON_USER_DEFINED_DATATYPE, + Name: INDEX_ON_USER_DEFINED_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_USER_DEFINED_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnUserDefinedTypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnUserDefinedDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnCitextDatatypeIssue = issue.Issue{ + Type: INDEX_ON_CITEXT_DATATYPE, + Name: INDEX_ON_CITEXT_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_CITEXT_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnCitextDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnCitextDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnTsVectorDatatypeIssue = issue.Issue{ + Type: INDEX_ON_TSVECTOR_DATATYPE, + Name: INDEX_ON_TSVECTOR_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_TSVECTOR_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnTsVectorDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnTsVectorDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnTsQueryDatatypeIssue = issue.Issue{ + Type: INDEX_ON_TSQUERY_DATATYPE, + Name: INDEX_ON_TSQUERY_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_TSQUERY_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnTsQueryDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnTsQueryDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnJsonbDatatypeIssue = issue.Issue{ + Type: INDEX_ON_JSONB_DATATYPE, + Name: INDEX_ON_JSONB_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_JSONB_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnJsonbDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnJsonbDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnInetDatatypeIssue = issue.Issue{ + Type: INDEX_ON_INET_DATATYPE, + Name: INDEX_ON_INET_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_INET_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnInetDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnInetDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnJsonDatatypeIssue = issue.Issue{ + Type: INDEX_ON_JSON_DATATYPE, + Name: INDEX_ON_JSON_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_JSON_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnJsonDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnJsonDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnMacaddrDatatypeIssue = issue.Issue{ + Type: INDEX_ON_MACADDR_DATATYPE, + Name: INDEX_ON_MACADDR_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_MACADDR_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnMacaddrDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnMacaddrDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnMacaddr8DatatypeIssue = issue.Issue{ + Type: INDEX_ON_MACADDR8_DATATYPE, + Name: INDEX_ON_MACADDR8_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_MACADDR8_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnMacaddr8DatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnMacaddr8DatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnCidrDatatypeIssue = issue.Issue{ + Type: INDEX_ON_CIDR_DATATYPE, + Name: INDEX_ON_CIDR_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_CIDR_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnCidrDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnCidrDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnBitDatatypeIssue = issue.Issue{ + Type: INDEX_ON_BIT_DATATYPE, + Name: INDEX_ON_BIT_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_BIT_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnBitDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnBitDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnVarbitDatatypeIssue = issue.Issue{ + Type: INDEX_ON_VARBIT_DATATYPE, + Name: INDEX_ON_VARBIT_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_VARBIT_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnVarbitDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnVarbitDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnDaterangeDatatypeIssue = issue.Issue{ + Type: INDEX_ON_DATERANGE_DATATYPE, + Name: INDEX_ON_DATERANGE_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_DATERANGE_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnDaterangeDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnDaterangeDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnTsrangeDatatypeIssue = issue.Issue{ + Type: INDEX_ON_TSRANGE_DATATYPE, + Name: INDEX_ON_TSRANGE_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_TSRANGE_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnTsrangeDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnTsrangeDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnTstzrangeDatatypeIssue = issue.Issue{ + Type: INDEX_ON_TSTZRANGE_DATATYPE, + Name: INDEX_ON_TSTZRANGE_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_TSTZRANGE_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnTstzrangeDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnTstzrangeDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnNumrangeDatatypeIssue = issue.Issue{ + Type: INDEX_ON_NUMRANGE_DATATYPE, + Name: INDEX_ON_NUMRANGE_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_NUMRANGE_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnNumrangeDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnNumrangeDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnInt4rangeDatatypeIssue = issue.Issue{ + Type: INDEX_ON_INT4RANGE_DATATYPE, + Name: INDEX_ON_INT4RANGE_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_INT4RANGE_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnInt4rangeDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnInt4rangeDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnInt8rangeDatatypeIssue = issue.Issue{ + Type: INDEX_ON_INT8RANGE_DATATYPE, + Name: INDEX_ON_INT8RANGE_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_INT8RANGE_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnInt8rangeDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnInt8rangeDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnIntervalDatatypeIssue = issue.Issue{ + Type: INDEX_ON_INTERVAL_DATATYPE, + Name: INDEX_ON_INTERVAL_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_INTERVAL_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnIntervalDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnIntervalDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnCircleDatatypeIssue = issue.Issue{ + Type: INDEX_ON_CIRCLE_DATATYPE, + Name: INDEX_ON_CIRCLE_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_CIRCLE_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnCircleDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnCircleDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnBoxDatatypeIssue = issue.Issue{ + Type: INDEX_ON_BOX_DATATYPE, + Name: INDEX_ON_BOX_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_BOX_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnBoxDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnBoxDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnLineDatatypeIssue = issue.Issue{ + Type: INDEX_ON_LINE_DATATYPE, + Name: INDEX_ON_LINE_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_LINE_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnLineDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnLineDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnLsegDatatypeIssue = issue.Issue{ + Type: INDEX_ON_LSEG_DATATYPE, + Name: INDEX_ON_LSEG_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_LSEG_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnLsegDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnLsegDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnPointDatatypeIssue = issue.Issue{ + Type: INDEX_ON_POINT_DATATYPE, + Name: INDEX_ON_POINT_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_POINT_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnPointDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnPointDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnPgLsnDatatypeIssue = issue.Issue{ + Type: INDEX_ON_PG_LSN_DATATYPE, + Name: INDEX_ON_PG_LSN_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_PG_LSN_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnPgLsnDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnPgLsnDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnPathDatatypeIssue = issue.Issue{ + Type: INDEX_ON_PATH_DATATYPE, + Name: INDEX_ON_PATH_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_PATH_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnPathDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnPathDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnPolygonDatatypeIssue = issue.Issue{ + Type: INDEX_ON_POLYGON_DATATYPE, + Name: INDEX_ON_POLYGON_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_POLYGON_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnPolygonDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnPolygonDatatypeIssue + return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var indexOnTxidSnapshotDatatypeIssue = issue.Issue{ + Type: INDEX_ON_TXID_SNAPSHOT_DATATYPE, + Name: INDEX_ON_TXID_SNAPSHOT_DATATYPE_ISSUE_NAME, + Impact: constants.IMPACT_LEVEL_1, + Description: INDEX_ON_TXID_SNAPSHOT_DATATYPE_ISSUE_DESCRIPTION, + GH: "https://github.com/yugabyte/yugabyte-db/issues/25003", + Suggestion: INDEX_ON_COMPLEX_DATATYPE_ISSUE_SUGGESTION, + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#indexes-on-some-complex-data-types-are-not-supported", +} + +func NewIndexOnTxidSnapshotDatatypeIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + issue := indexOnTxidSnapshotDatatypeIssue return newQueryIssue(issue, objectType, objectName, sqlStatement, map[string]interface{}{}) } diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index 1f148e778b..adfa1020a7 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -540,6 +540,285 @@ func testCompressionClauseIssue(t *testing.T) { } +func testIndexOnComplexDataType(t *testing.T) { + // Reference for some of the types https://docs.yugabyte.com/stable/api/ysql/datatypes/ (datatypes with type 1) + // var UnsupportedIndexDatatypes = []string{ + // "citext", + // "tsvector", + // "tsquery", + // "jsonb", + // "inet", + // "json", + // "macaddr", + // "macaddr8", + // "cidr", + // "bit", // for BIT (n) + // "varbit", // for BIT varying (n) + // "daterange", + // "tsrange", + // "tstzrange", + // "numrange", + // "int4range", + // "int8range", + // "interval", // same for INTERVAL YEAR TO MONTH and INTERVAL DAY TO SECOND + // //Below ones are not supported on PG as well with atleast btree access method. Better to have in our list though + // //Need to understand if there is other method or way available in PG to have these index key [TODO] + // "circle", + // "box", + // "line", + // "lseg", + // "point", + // "pg_lsn", + // "path", + // "polygon", + // "txid_snapshot", + // // array as well but no need to add it in the list as fetching this type is a different way TODO: handle better with specific types + // } + + // We have to create indexes on the tables to check if the index creation is supported or not + // We will create indexes on the unsupported datatypes and check if the index creation fails + + type testIndexOnComplexDataTypeTests struct { + sql string + errMsgBase string + errMsgv2_25_0_0 string + Issue issue.Issue + } + + testCases := []testIndexOnComplexDataTypeTests{ + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE citext_table (id int, name CITEXT); + CREATE INDEX citext_index ON citext_table (name);`, + errMsgBase: "ERROR: type \"citext\" does not exist (SQLSTATE 42704)", + errMsgv2_25_0_0: "", + Issue: indexOnCitextDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE tsvector_table (id int, name TSVECTOR); + CREATE INDEX tsvector_index ON tsvector_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'TSVECTOR' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnTsVectorDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE tsquery_table (id int, name TSQUERY); + CREATE INDEX tsquery_index ON tsquery_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'TSQUERY' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnTsQueryDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE jsonb_table (id int, name JSONB); + CREATE INDEX jsonb_index ON jsonb_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'JSONB' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnJsonbDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE inet_table (id int, name INET); + CREATE INDEX inet_index ON inet_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'INET' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnInetDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE json_table (id int, name JSON); + CREATE INDEX json_index ON json_table (name);`, + errMsgBase: "ERROR: data type json has no default operator class for access method \"lsm\" (SQLSTATE 42704)", + errMsgv2_25_0_0: "", + Issue: indexOnJsonDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE macaddr_table (id int, name MACADDR); + CREATE INDEX macaddr_index ON macaddr_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'MACADDR' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnMacaddrDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE macaddr8_table (id int, name MACADDR8); + CREATE INDEX macaddr8_index ON macaddr8_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'MACADDR8' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnMacaddr8DatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE cidr_table (id int, name CIDR); + CREATE INDEX cidr_index ON cidr_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'CIDR' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnCidrDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE bit_table (id int, name BIT(10)); + CREATE INDEX bit_index ON bit_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'BIT' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnBitDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE varbit_table (id int, name VARBIT(10)); + CREATE INDEX varbit_index ON varbit_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'VARBIT' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnVarbitDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE daterange_table (id int, name DATERANGE); + CREATE INDEX daterange_index ON daterange_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'user_defined_type' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "ERROR: INDEX on column of type 'DATERANGE' not yet supported (SQLSTATE 0A000)", + Issue: indexOnDaterangeDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE tsrange_table (id int, name TSRANGE); + CREATE INDEX tsrange_index ON tsrange_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'user_defined_type' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "ERROR: INDEX on column of type 'TSRANGE' not yet supported (SQLSTATE 0A000)", + Issue: indexOnTsrangeDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE tstzrange_table (id int, name TSTZRANGE); + CREATE INDEX tstzrange_index ON tstzrange_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'user_defined_type' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "ERROR: INDEX on column of type 'TSTZRANGE' not yet supported (SQLSTATE 0A000)", + Issue: indexOnTstzrangeDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE numrange_table (id int, name NUMRANGE); + CREATE INDEX numrange_index ON numrange_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'user_defined_type' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "ERROR: INDEX on column of type 'NUMRANGE' not yet supported (SQLSTATE 0A000)", + Issue: indexOnNumrangeDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE int4range_table (id int, name INT4RANGE); + CREATE INDEX int4range_index ON int4range_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'INT4RANGE' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnInt4rangeDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE int8range_table (id int, name INT8RANGE); + CREATE INDEX int8range_index ON int8range_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'user_defined_type' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "ERROR: INDEX on column of type 'INT8RANGE' not yet supported (SQLSTATE 0A000)", + Issue: indexOnInt8rangeDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE interval_table (id int, name INTERVAL); + CREATE INDEX interval_index ON interval_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'INTERVAL' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnIntervalDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE circle_table (id int, name CIRCLE); + CREATE INDEX circle_index ON circle_table (name);`, + errMsgBase: "ERROR: data type circle has no default operator class for access method \"lsm\" (SQLSTATE 42704)", + errMsgv2_25_0_0: "", + Issue: indexOnCircleDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE box_table (id int, name BOX); + CREATE INDEX box_index ON box_table (name);`, + errMsgBase: "ERROR: data type box has no default operator class for access method \"lsm\" (SQLSTATE 42704)", + errMsgv2_25_0_0: "", + Issue: indexOnBoxDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE line_table (id int, name LINE); + CREATE INDEX line_index ON line_table (name);`, + errMsgBase: "ERROR: data type line has no default operator class for access method \"lsm\" (SQLSTATE 42704)", + errMsgv2_25_0_0: "", + Issue: indexOnLineDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE lseg_table (id int, name LSEG); + CREATE INDEX lseg_index ON lseg_table (name);`, + errMsgBase: "ERROR: data type lseg has no default operator class for access method \"lsm\" (SQLSTATE 42704)", + errMsgv2_25_0_0: "", + Issue: indexOnLsegDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE point_table (id int, name POINT); + CREATE INDEX point_index ON point_table (name);`, + errMsgBase: "ERROR: data type point has no default operator class for access method \"lsm\" (SQLSTATE 42704)", + errMsgv2_25_0_0: "", + Issue: indexOnPointDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE path_table (id int, name PATH); + CREATE INDEX path_index ON path_table (name);`, + errMsgBase: "ERROR: data type path has no default operator class for access method \"lsm\" (SQLSTATE 42704)", + errMsgv2_25_0_0: "", + Issue: indexOnPathDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE polygon_table (id int, name POLYGON); + CREATE INDEX polygon_index ON polygon_table (name);`, + errMsgBase: "ERROR: data type polygon has no default operator class for access method \"lsm\" (SQLSTATE 42704)", + errMsgv2_25_0_0: "", + Issue: indexOnPolygonDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE txid_snapshot_table (id int, name TXID_SNAPSHOT); + CREATE INDEX txid_snapshot_index ON txid_snapshot_table (name);`, + errMsgBase: "ERROR: data type txid_snapshot has no default operator class for access method \"lsm\" (SQLSTATE 42704)", + errMsgv2_25_0_0: "", + Issue: indexOnTxidSnapshotDatatypeIssue, + }, + // One with array datatype + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE array_table (id int, name int[]); + CREATE INDEX array_index ON array_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'INT4ARRAY' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnArrayDatatypeIssue, + }, + // One with UDT datatype + testIndexOnComplexDataTypeTests{ + sql: `CREATE TYPE my_udt AS (a int, b text); + CREATE TABLE udt_table (id int, name my_udt); + CREATE INDEX udt_index ON udt_table (name);`, + errMsgBase: "ERROR: INDEX on column of type 'user_defined_type' not yet supported (SQLSTATE 0A000)", + errMsgv2_25_0_0: "", + Issue: indexOnUserDefinedDatatypeIssue, + }, + testIndexOnComplexDataTypeTests{ + sql: `CREATE TABLE pg_lsn_table (id int, name PG_LSN); + CREATE INDEX pg_lsn_index ON pg_lsn_table (name);`, + errMsgBase: "", // It is possible to create index on pg_lsn datatype but operations on it throw error in YB + errMsgv2_25_0_0: "", + Issue: indexOnPgLsnDatatypeIssue, + }, + } + + for _, testCase := range testCases { + ctx := context.Background() + conn, err := getConn() + assert.NoError(t, err) + + var errMsg string + if testYbVersion.ReleaseType() == ybversion.V2_25_0_0.ReleaseType() && testYbVersion.GreaterThanOrEqual(ybversion.V2_25_0_0) && testCase.errMsgv2_25_0_0 != "" { + errMsg = testCase.errMsgv2_25_0_0 + } else { + errMsg = testCase.errMsgBase + } + + _, err = conn.Exec(ctx, testCase.sql) + fmt.Println("Query executed: ", testCase.sql) + if errMsg == "" { // For the pg_lsn datatype, we are not throwing any error but the operations on it throw error + assert.NoError(t, err) + assertErrorCorrectlyThrownForIssueForYBVersion(t, fmt.Errorf(""), errMsg, testCase.Issue) + } else { + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, errMsg, testCase.Issue) + } + + conn.Close(ctx) + } +} + func TestDDLIssuesInYBVersion(t *testing.T) { var err error ybVersion := os.Getenv("YB_VERSION") @@ -620,4 +899,7 @@ func TestDDLIssuesInYBVersion(t *testing.T) { success = t.Run(fmt.Sprintf("%s-%s", "database options", ybVersion), testDatabaseOptions) assert.True(t, success) + success = t.Run(fmt.Sprintf("%s-%s", "index on complex data type", ybVersion), testIndexOnComplexDataType) + assert.True(t, success) + } diff --git a/yb-voyager/src/query/queryissue/parser_issue_detector_test.go b/yb-voyager/src/query/queryissue/parser_issue_detector_test.go index ee8a921d2f..48bf675fa2 100644 --- a/yb-voyager/src/query/queryissue/parser_issue_detector_test.go +++ b/yb-voyager/src/query/queryissue/parser_issue_detector_test.go @@ -235,7 +235,7 @@ func TestAllIssues(t *testing.T) { NewExclusionConstraintIssue("TABLE", "Test", stmt11, "no_time_overlap_constr"), }, stmt13: []QueryIssue{ - NewIndexOnComplexDatatypesIssue("INDEX", "idx_on_daterange ON test_dt", stmt13, "daterange"), + NewIndexOnDaterangeDatatypeIssue("INDEX", "idx_on_daterange ON test_dt", stmt13), }, } @@ -1374,7 +1374,6 @@ $$;`, NewTwoPhaseCommitIssue("PROCEDURE", "transfer_money", "COMMIT PREPARED 'txn_db1';"), NewTwoPhaseCommitIssue("PROCEDURE", "transfer_money", "ROLLBACK PREPARED 'txn_db1';"), }, - } parserIssueDetector := NewParserIssueDetector() for stmt, expectedIssues := range stmtsWithExpectedIssues { @@ -1389,11 +1388,10 @@ $$;`, assert.True(t, found, "Expected issue not found: %v in statement: %s", expectedIssue, stmt) } } - + _, err := parserIssueDetector.GetAllIssues(`PREPARE TRANSACTION $1`, ybversion.LatestStable) assert.Error(t, err, `syntax error at or near "$1"`) - } func TestCompressionClause(t *testing.T) { @@ -1421,5 +1419,5 @@ func TestCompressionClause(t *testing.T) { assert.True(t, found, "Expected issue not found: %v in statement: %s", expectedIssue, stmt) } } - + }