Activerecord Citus“;创建“分布式”表;给予;PG::未定义的列“;

Activerecord Citus“;创建“分布式”表;给予;PG::未定义的列“;,activerecord,citus,acts-as-tenant,Activerecord,Citus,Acts As Tenant,当尝试使用Citus创建分布式表时,它会给出一个PG::UndefinedColumn:ERROR:列“x”不存在 我已在workers和main DB上启用Citus: SELECT run_command_on_workers($cmd$ CREATE EXTENSION citus; $cmd$); 我创建了一个复合主键: ActiveRecord::Base.connection.execute(" ALTER TABLE x DROP CONSTRAINT x_pk

当尝试使用Citus创建分布式表时,它会给出一个
PG::UndefinedColumn:ERROR:列“x”不存在

我已在workers和main DB上启用Citus:

SELECT run_command_on_workers($cmd$
  CREATE EXTENSION citus;
$cmd$);
我创建了一个复合主键:

ActiveRecord::Base.connection.execute("
  ALTER TABLE x DROP CONSTRAINT x_pkey CASCADE;
")
ActiveRecord::Base.connection.execute("
  ALTER TABLE x ADD PRIMARY KEY (tenant_id, id);
")
尝试执行以下操作时:

ActiveRecord::Base.connection.execute("
SELECT create_distributed_table(x, tenant_id);
")
它一直在说:

ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column "x" does not exist
LINE 2: SELECT create_distributed_table(x, tenant_id...
                                        ^
Caused by PG::UndefinedColumn: ERROR:  column "x" does not exist

有什么我忘记了吗?

表名和列名需要以单引号作为文本值传递:选择create_distributed_table('x','tenant_id')