Postgres 复制不适用于 Base64 内容
我正在使用 PostgreSQL 12。我已经设置了复制。并且还为副本数据库中的所有表设置版本控制历史记录触发器来存储审核历史记录。但在其中一张表中,我存储了 based64 内容,但它没有在副本数据库中正确复制,并且正在停止数据库服务器。
它正在抛出错误。
FATAL: the database system is in recovery mode
并非所有情况都会发生这种情况。
副本数据库中的 Base64(XML) 内容(无效内容)
谁能帮我解释为什么会发生这种情况?提前致谢。
以下是配置复制的步骤:
发布数据库:
- 创建`REPLICA IDENTITY并将其分配给每个表
- 创建复制槽和发布:
从 pg_create_logic_replication_slot('pubqablankdb','pgoutput') 中选择 1
为所有表创建发布 pubqablankdb
订阅数据库:
- 创建订阅:
创建订阅 subqablankdb 连接 'host=1.1.1.1 port=5432 user=postgres 密码=xxxxx dbname=qablankdb' 发布 pubqablankdb with (create_slot= false,slot_name = 'pubqablankdb',enabled = true);
请参阅下面的数据库信息。 (UTF8 编码)
Master DB: qablankdb
Replica DB: auditlog
I'm using PostgreSQL 12. I have set up replication. And also set up the versioning history trigger for all the tables in the replica database to store audit history. But here in one of the tables, I'm storing the based64 content and it is not replicated properly in the replica database and it is stopping the database server.
It is throwing the error.
FATAL: the database system is in recovery mode
It is not happing in every case.
Base64(XML) Content in Master Database
Base64(XML) Content(InValid Conent) in Replica Database
Can anyone help me with why it is happening? Thanks in advance.
Below are the steps for configuration the replication:
Publication Databaase:
- Creating the `REPLICA IDENTITY and assigning it to each table
- Creating replication slot and publication :
select 1 from pg_create_logical_replication_slot('pubqablankdb','pgoutput')
create publication pubqablankdb for all tables
Subscription Database:
- Creating Subscription:
CREATE SUBSCRIPTION subqablankdb CONNECTION 'host=1.1.1.1 port=5432 user=postgres password=xxxxx dbname=qablankdb' PUBLICATION pubqablankdb with (create_slot= false,slot_name = 'pubqablankdb', enabled = true);
Please see below the database info. (UTF8 encoding)
Master DB: qablankdb
Replica DB: auditlog
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论