0

我正在尝试复制包含 jsonB 列的表。我想使用行过滤来仅选择我需要的行。如何为 jsonB 定义行过滤器?

表人:

        id                  serial,
        name                TEXT NOT NULL,
        details          JSONB NOT NULL,
        modified_at         TIMESTAMPTZ NOT NULL DEFAULT NOW(),
        PRIMARY KEY (name)); 

样本数据:

 id |  name   |     details     |          modified_at          
----+---------+-----------------+-------------------------------
  1 | person1 | {"city": "nyc"} | 2021-05-17 06:05:55.735086+00
  2 | person2 | {"city": "SF"}  | 2021-05-17 06:06:30.028065+00

我尝试了以下方法,但它们不起作用:

SELECT pglogical.replication_set_add_table(set_name:= 'replicate1', relation := 'person', row_filter:= details->>'city' = 'nyc');

我尝试的另一个选项:

SELECT pglogical.replication_set_add_table(set_name:= 'replicate1', relation := 'person', row_filter:= "details->>'city' = 'nyc'");
4

1 回答 1

0

可以在这里找到解决方案:https ://github.com/2ndQuadrant/pglogical/issues/332

于 2021-08-17T07:39:29.183 回答