[英]Moving records from one database instance to another
I have a PostgreSQL database instance located in EU region.我有一个位于欧盟地区的 PostgreSQL 数据库实例。 I plan on introducing another PostgreSQL database instance located in a new geographical region.
我计划引入另一个位于新地理区域的 PostgreSQL 数据库实例。
As part this work, I am to migrate data for selected customers from a database instance in EU to a database instance in this new geo region and am seeking for advice.作为这项工作的一部分,我要将选定客户的数据从欧盟的数据库实例迁移到这个新地理区域的数据库实例,并寻求建议。
On a surface, this boils down to doing the following work:从表面上看,这归结为做以下工作:
accounts.id
,accounts.id
,accounts
table from EU database instance to accounts
table in another region's database instance,accounts
表中查找记录并将其复制到另一个区域的数据库实例中的accounts
表,account
record, recursively (eg as well as potentially from tables related to those tables...).account
记录相关的所有表中的记录(例如,以及可能从与这些表相关的表中......)。 Effectively, having a specific DB record as starting point, I need to:实际上,以特定的数据库记录为起点,我需要:
INSERT
statement,INSERT
语句的字符串,INSERT
statements, in a transaction, on another database instance.INSERT
语句。 It appears as if I might need to build a tool to do this kind of work.看来我可能需要构建一个工具来完成此类工作。 But before I do, I wonder:
但在我这样做之前,我想知道:
Indeed You need a whole proccess yo do this, i think that You should create a new schema to do the data Select i think functions could do the magic, then replicate that data.事实上,你需要一个完整的过程来做这件事,我认为你应该创建一个新的模式来处理数据 Select 我认为函数可以发挥魔力,然后复制该数据。
They replication tool it's not that hard to configurate.他们的复制工具配置起来并不难。
Here it's the link: https://www.postgresql.org/docs/current/runtime-config-replication.html !这是链接: https://www.postgresql.org/docs/current/runtime-config-replication.html !
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.