diff --git a/src/backend/distributed/commands/schema.c b/src/backend/distributed/commands/schema.c index c16b87fa2..966a264d6 100644 --- a/src/backend/distributed/commands/schema.c +++ b/src/backend/distributed/commands/schema.c @@ -95,10 +95,11 @@ PostprocessCreateSchemaStmt(Node *node, const char *queryString) if (CreateSchemaStmtCreatesTable(createSchemaStmt)) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot create tenant table in CREATE " - "SCHEMA statement"), - errhint("Use CREATE TABLE statement to create " - "tenant tables."))); + errmsg("cannot create distributed schema and table in a " + "single statement"), + errhint("SET citus.enable_schema_based_sharding TO off, " + "or create the schema and table in separate " + "commands."))); } /* diff --git a/src/test/regress/expected/schema_based_sharding.out b/src/test/regress/expected/schema_based_sharding.out index ad456ad8e..00198d7dc 100644 --- a/src/test/regress/expected/schema_based_sharding.out +++ b/src/test/regress/expected/schema_based_sharding.out @@ -314,8 +314,8 @@ WHERE schemaid::regnamespace::text IN ('tenant_1', 'tenant_2'); -- verify that we don't allow creating tenant tables via CREATE SCHEMA command CREATE SCHEMA schema_using_schema_elements CREATE TABLE test_table(a int, b text); -ERROR: cannot create tenant table in CREATE SCHEMA statement -HINT: Use CREATE TABLE statement to create tenant tables. +ERROR: cannot create distributed schema and table in a single statement +HINT: SET citus.enable_schema_based_sharding TO off, or create the schema and table in separate commands. CREATE SCHEMA tenant_4; CREATE TABLE tenant_4.tbl_1(a int, b text); CREATE TABLE tenant_4.tbl_2(a int, b text);