Logical Replication of DDLs: Peter Smith & Zheng Li (Zane) - PGCon 2023

Here is the meta description: "Learn how logical replication of DDLs enables better schema management and improves data consistency, reduced errors and increased flexibility with PostgreSQL's future feature development."

Key takeaways
  • The speaker introduces the concept of logical replication of DDLs, allowing for better management of schema changes and replication.
  • The speaker explains that current solutions to DDL replication are limited and often require manual intervention.
  • A new command has been proposed to handle DDL replication, which can be configured to publish and subscribe to DDL commands.
  • The speaker highlights the importance of logical replication, particularly for complex DDL commands such as create table as, alter table with table rewrite function, and grant commands.
  • The speaker discusses the challenges of capturing DDL commands, including the need for fine-grained replication granularity and the ability to handle special cases such as global commands and initial schema sync.
  • The speaker presents a simplified architecture for DDL replication, including the publisher, event trigger, and subscriber components.
  • The speaker emphasizes the importance of transformation and mapping between schema names, as well as data type conversion and consistency.
  • The speaker notes that logical replication of DDLs is not yet supported in PostgreSQL, but is a feature that is being developed and will be available in future versions.
  • The speaker highlights the benefits of logical replication, including improved data consistency, reduced errors, and increased flexibility for schema management.
  • The speaker mentions that event triggers can be used to capture DDL commands and that the publication parameter “DDL” can be used to enable DDL replication.
  • The speaker discusses the need for a robust testing framework to ensure the correctness of DDL replication.
  • The speaker notes that DDL replication is still an ongoing development and that there are many edge cases to be handled, including issues related to global commands, initial schema sync, and data type conversion.