diff --git a/src/backend/distributed/deparser/citus_ruleutils.c b/src/backend/distributed/deparser/citus_ruleutils.c index 9f5b0f905..9203d9364 100644 --- a/src/backend/distributed/deparser/citus_ruleutils.c +++ b/src/backend/distributed/deparser/citus_ruleutils.c @@ -37,6 +37,7 @@ #include "commands/defrem.h" #include "commands/extension.h" #include "distributed/citus_ruleutils.h" +#include "distributed/listutils.h" #include "distributed/multi_partitioning_utils.h" #include "distributed/relay_utility.h" #include "distributed/metadata_utility.h" @@ -813,6 +814,11 @@ deparse_index_columns(StringInfo buffer, List *indexParameterList, List *deparse appendStringInfo(buffer, "%s ", NameListToQuotedString(indexElement->opclass)); } +#if PG_VERSION_NUM >= PG_VERSION_13 + if (indexElement->opclassopts != NIL) { + ereport(ERROR, errmsg("citus currently doesn't support this index arguments")); + } +#endif if (indexElement->ordering != SORTBY_DEFAULT) { diff --git a/src/test/regress/expected/pg13.out b/src/test/regress/expected/pg13.out index 26bc678fd..8bc788ae1 100644 --- a/src/test/regress/expected/pg13.out +++ b/src/test/regress/expected/pg13.out @@ -153,8 +153,18 @@ CREATE TABLE my_table (a int, b myvarchar); SELECT create_distributed_table('my_table', 'a'); ERROR: type "test_pg13.myvarchar" does not exist CONTEXT: while executing command on localhost:xxxxx +CREATE TABLE test_table(a int, b tsvector); +SELECT create_distributed_table('test_table', 'a'); + create_distributed_table +--------------------------------------------------------------------- + +(1 row) + +-- we currently don't support this +CREATE INDEX test_table_index ON test_table USING gist (b tsvector_ops(siglen = 100)); +ERROR: citus currently doesn't support this index arguments drop schema test_pg13 cascade; -NOTICE: drop cascades to 9 other objects +NOTICE: drop cascades to 10 other objects DETAIL: drop cascades to table dist_table drop cascades to table generated_col_table drop cascades to view v @@ -164,3 +174,4 @@ drop cascades to function myvarcharout(myvarchar) drop cascades to type myvarchar drop cascades to function myvarcharin(cstring,oid,integer) drop cascades to table my_table +drop cascades to table test_table diff --git a/src/test/regress/sql/pg13.sql b/src/test/regress/sql/pg13.sql index 8509654d2..40d6d08e5 100644 --- a/src/test/regress/sql/pg13.sql +++ b/src/test/regress/sql/pg13.sql @@ -81,4 +81,9 @@ CREATE TABLE my_table (a int, b myvarchar); -- like TOAST and I/O functions control (Tomas Vondra, Tom Lane)""" SELECT create_distributed_table('my_table', 'a'); +CREATE TABLE test_table(a int, b tsvector); +SELECT create_distributed_table('test_table', 'a'); +-- we currently don't support this +CREATE INDEX test_table_index ON test_table USING gist (b tsvector_ops(siglen = 100)); + drop schema test_pg13 cascade; \ No newline at end of file