<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Hi Ben,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thank you so much for your quick response.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Yeah, that is a work around to avoid the auto incremental number collision.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Also, based on your experience, do you have any thoughts on my other questions? Don't have to be exact answer, just want to learn from your experience, since we are very new to this tool.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thank you so much.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Take care,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Su.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Ben Chobot <bench@silentmedia.com><br>
<b>Sent:</b> Thursday, January 20, 2022 3:26 PM<br>
<b>To:</b> Su Yu <su.yu.tech@outlook.com><br>
<b>Cc:</b> bucardo-general@bucardo.org <bucardo-general@bucardo.org><br>
<b>Subject:</b> Re: [Bucardo-general] Migrate Data Between RDS Postgres Clusters using Bucardo</font>
<div> </div>
</div>
<div>I can't authoritatively speak to most of your questions, but...<br>
<br>
<span>Su Yu wrote on 1/20/22 3:02 PM:</span><br>
<blockquote type="cite">
<div><b>Question 2: Table has "auto increment" primary key.</b></div>
<div>We have some use cases using sequence <span style="color:rgb(51,103,145); font-family:monospace,monospace; font-size:14.4px">nextval </span>to generate incremental numbers as the primary keys for the table. And I have a concern about key collisions during
 migration. Because when we switch the application endpoint, we will have moments that application pods point to both old and new clusters. That might have a chance to create primary key collisions. Is this concern valid?</div>
</blockquote>
Yes, this is absolutely a concern. We have the same problem independent of RDS. Before you enter the transient switchover period when you are rolling with a real multi-master database, you'll want to tweak your sequences so that one db will only make even values
 and the other only odd values. (Or use different math if you have more than one potential source of ids, but the key is that you're going to need to make sure your sequences are set up to not make id conflicts.)<br>
<br>
After your migration, you can tweak your sequences to autoincrement by 1 again (or whatever is appropriate for you).<br>
</div>
</body>
</html>