logical_ddl
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
logical_ddl | 0.1.0 | ETL | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 9530 | logical_ddl | No | Yes | No | Yes | No | No | logical_ddl |
Pigsty carries the upstream RAISE WARNING typo fix for 0.1.0.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.0 | 1817161514 | logical_ddl | - |
| RPM | PIGSTY | 0.1.0 | 1817161514 | logical_ddl_$v | - |
| DEB | PIGSTY | 0.1.0 | 1817161514 | postgresql-$v-logical-ddl | - |
Build
You can build the RPM / DEB packages for logical_ddl using pig build:
pig build pkg logical_ddl # build RPM / DEB packages
Install
You can install logical_ddl directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install logical_ddl; # Install for current active PG version
pig ext install -y logical_ddl -v 18 # PG 18
pig ext install -y logical_ddl -v 17 # PG 17
pig ext install -y logical_ddl -v 16 # PG 16
pig ext install -y logical_ddl -v 15 # PG 15
pig ext install -y logical_ddl -v 14 # PG 14
dnf install -y logical_ddl_18 # PG 18
dnf install -y logical_ddl_17 # PG 17
dnf install -y logical_ddl_16 # PG 16
dnf install -y logical_ddl_15 # PG 15
dnf install -y logical_ddl_14 # PG 14
apt install -y postgresql-18-logical-ddl # PG 18
apt install -y postgresql-17-logical-ddl # PG 17
apt install -y postgresql-16-logical-ddl # PG 16
apt install -y postgresql-15-logical-ddl # PG 15
apt install -y postgresql-14-logical-ddl # PG 14
Create Extension:
CREATE EXTENSION logical_ddl;
Usage
- GitHub Repo:
samedyildirim/logical_ddl - README: samedyildirim/logical_ddl/blob/master/README.md
logical_ddl captures supported DDL changes on tables and replays them through built-in logical replication. The project is aimed at reducing manual DDL operations and avoiding schema drift between publisher and subscriber.
The README states PostgreSQL 11 and above are supported, and the extension works under superuser privileges.
What It Captures
Supported DDL operations are:
ALTER TABLE ... RENAME TO ...ALTER TABLE ... RENAME COLUMN ... TO ...ALTER TABLE ... ADD COLUMN ...ALTER TABLE ... ALTER COLUMN ... TYPE ...ALTER TABLE ... DROP COLUMN ...
The README also notes that built-in types, arrays, composite types, domains, and enums are supported, but definitions of composite types, domains, and enums themselves are not replicated.
Publisher Side
CREATE EXTENSION logical_ddl;
INSERT INTO logical_ddl.settings VALUES (true, 'source1');
INSERT INTO logical_ddl.publish_tablelist (relid) VALUES ('table1'::regclass);
ALTER PUBLICATION log_pub_1 ADD TABLE logical_ddl.shadow_table;
The extension captures DDL with an event trigger, stores it in logical_ddl.shadow_table, and publishes that table through logical replication.
Subscriber Side
CREATE EXTENSION logical_ddl;
INSERT INTO logical_ddl.settings VALUES (false, 'source1');
INSERT INTO logical_ddl.subscribe_tablelist (source, relid) VALUES ('source1', 'table1'::regclass);
ALTER SUBSCRIPTION log_sub_1 REFRESH PUBLICATION;
On the subscriber, the extension listens for incoming DDL records and replays the generated SQL against the target table.
Data Model
logical_ddl.settingscontrols whether the node acts as publisher, subscriber, or both.logical_ddl.publish_tablelistcontrols which tables and command kinds are captured.logical_ddl.subscribe_tablelistcontrols which tables receive replayed DDL.logical_ddl.shadow_tablestores captured commands.logical_ddl.applied_commandstracks generated SQL and whether execution failed.
Caveats
- DDL support is limited to the operations listed above.
- Default expressions, constraints, indexes, and
USINGexpressions are not implemented. - The README notes the project is still under development and may change incompatibly.
Scope
The upstream README was enough to cover the extension model, captured DDL types, publisher/subscriber setup, and the known caveats. No extra docs page or homepage was needed for the stub.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.