跳到主要内容

tcb db pg realtime enable

为 PG 模式环境开通 Realtime 服务,覆盖 Broadcast、Presence 与 PostgreSQL CDC(postgres_changes)。

版本

tcb db pg realtime 系列命令自 v3.9.0 起提供。

语法​

tcb db pg realtime enable -e <envId>

参数​

参数必填说明默认值
-e, --env-id <envId>是环境 ID—
--json否以 JSON 格式输出结果—

示例​

# 开通
tcb db pg realtime enable -e <envId>

# 输出 JSON,便于流水线消费
tcb db pg realtime enable -e <envId> --json

JSON 输出形如:

{
"Enabled": true,
"RequestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

注意事项​

  • 命令幂等。已开通的环境重复执行不报错;处于挂起状态的环境执行后恢复服务
  • 只调整服务状态,不改动限流阈值、频道策略等配置
  • 恢复服务会断开所有已有连接,客户端需重新连接并订阅频道
  • 开通未生效时命令按失败处理,不会静默成功
  • 限流阈值、频道策略等配置用 set 调整,当前值用 get 查询