- Newest
- Most votes
- Most comments
DMS while migrating from postgresql to postgresql wont migrate the sequence property
post the data is migrated you need to setup sequences manually on target and also set the nextval
example script where table is foo and foo_a_seq is sequence
CREATE SEQUENCE foo_a_seq OWNED BY foo.a;
SELECT setval('foo_a_seq', coalesce(max(a), 0)) FROM foo;
ALTER TABLE foo ALTER COLUMN a SET DEFAULT nextval('foo_a_seq');
Hello,
From my understanding, you want to know if DMS support updating value of sequences in the target for postgres to postgres data migration.
AWS DMS doesn’t migrate your secondary indexes, sequences, default values, stored procedures, triggers, synonyms, views, and other schema objects not specifically related to data migration. To migrate these objects to your PostgreSQL target, use AWS SCT[1]. For more information on AWS SCT, please refer to the link[2] below :
[1] Migrating an Oracle Database to PostgreSQL - https://docs.aws.amazon.com/dms/latest/sbs/chap-rdsoracle2postgresql.html [2] What is the AWS Schema Conversion Tool? - https://docs.aws.amazon.com/SchemaConversionTool/latest/userguide/CHAP_Welcome.html
Based on the the post, sequences is being used for ID columns in the PostgreSQL onprem database. Prior to initiating data migration, I would recommend that you consider manually creating the sequence on the target database. Once created, set the next values higher than they are on the source database(PostgreSQL onprem). I would suggest that you give enough gap to make sure that the values are higher than for the source database at the migration cutover date. This will avoid collisions in sequence IDs after the migration.
I hope this information is helpful.
Relevant content
- asked 2 years ago
- asked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago