其他人 "create_distributed_table" 给予 "PG::UndefinedColumn"
Citus "create_distributed_table" giving "PG::UndefinedColumn"
尝试使用 Citus 创建分布式 table 时,它给出 PG::UndefinedColumn: ERROR: column "x" does not exist
我已经在工作人员和主数据库上启用了 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
有什么我忘了的吗?
table 名称和列名称需要作为文本值在单引号中传递:SELECT create_distributed_table('x', 'tenant_id');
尝试使用 Citus 创建分布式 table 时,它给出 PG::UndefinedColumn: ERROR: column "x" does not exist
我已经在工作人员和主数据库上启用了 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
有什么我忘了的吗?
table 名称和列名称需要作为文本值在单引号中传递:SELECT create_distributed_table('x', 'tenant_id');