暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

PostgreSQL devel preview - logical replication row filter

digoal 2021-01-02
285

作者

digoal

日期

2021-02-28

标签

PostgreSQL , row filter , logical replication


背景

在内置的pub, sub逻辑发布, 订阅功能中支持where filter. 发布端过滤某些记录不被plugin decoding.

https://www.postgresql.org/message-id/flat/f6566ad9-8979-4056-a4ce-24b09f389ede%40www.fastmail.com#42694388e3195dbdb0979c27e4fb894a

CREATE PUBLICATION foo FOR TABLE departments WHERE (id > 2000 AND id <= 3000);

```
Hi,

The attached patches add support for filtering rows in the publisher.
The output plugin will do the work if a filter was defined in CREATE
PUBLICATION command. An optional WHERE clause can be added after the
table name in the CREATE PUBLICATION such as:

CREATE PUBLICATION foo FOR TABLE departments WHERE (id > 2000 AND id <= 3000);

Row that doesn't match the WHERE clause will not be sent to the subscribers.

Patches 0001 and 0002 are only refactors and can be applied
independently. 0003 doesn't include row filtering on initial
synchronization.

Comments?
```

PostgreSQL 许愿链接

您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.

9.9元购买3个月阿里云RDS PostgreSQL实例

PostgreSQL 解决方案集合

德哥 / digoal's github - 公益是一辈子的事.

digoal's wechat

文章转载自digoal,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论