Hi @CHUNSIK KIM,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
We apologize for the inconvenience caused to you.
As we understand that, you are facing a problem with the pgcopydb tool during the migration to Azure Database for PostgreSQL Flexible Server.
We would like to inform you that, online migration makes use of pgcopydb follow, and some of the logical decoding restrictions apply. We also recommend that you have a primary key in all the tables of a database that's undergoing online migration. If a primary key is absent, the deficiency results in only insert operations being reflected during migration, excluding updates or deletes. Add a temporary primary key to the relevant tables before you proceed with the online migration.
Note: In the case of online migration of tables without a primary key, only insert operations are replayed on the target. This can potentially introduce inconsistency in the database if records that are updated or deleted on the source don't reflect on the target.
An alternative is to use the ALTER TABLE command where the action is REPLICA IDENTIY with the FULL option. The FULL option records the old values of all columns in the row so that even in the absence of a primary key, all CRUD operations are reflected on the target during the online migration. If none of these options work, perform an offline migration as an alternative.
Note: For online migration with Azure Database for PostgreSQL single server, the Azure replication support is set to logical under the replication settings of the single server page in the Azure portal. And also, Change the password_encryption server parameter on your flexible server from SCRAM-SHA-256 to MD5 before initiating the migration. This is essential for the existing credentials on single server to work on your flexible server.
There are some restrictions for online migration please check the doc here. https://www.postgresql.org/docs/current/logical-replication-restrictions.html
pgcopydb, the underlying program, might not be able to handle double-quoted entities. Please make sure to enable quote_all_identifiers and try again.
Please refer to the below mentioned links for more information.
https://pgcopydb.readthedocs.io/en/latest/ref/pgcopydb_follow.html#pgcopydb-follow
If my response helped, kindly click 'Accept Answer' and select 'Yes' for 'Was this answer helpful.' this can be helpful to others in the community.
If you have any further questions or require additional assistance, please do not hesitate to let us know.