8/3/2023 0 Comments Reviews of postgresql client![]() ![]() The contents of the replicated table: 2> lists:sort(ets:tab2list(t1)).Īny changes on the PostgreSQL database will now be replicated in real-time to the ETS replica. This is the column that is used as the primary key in ETS replica of t1. Insert some test data into the newly created t1 table: insert into t1Īs part of the replication process pgmp introspects the table metadata for t1 determining that column id is the primary key. Version 0.8.0 of pgmp, includes some recent new PostgreSQL 15 features adding row filters and column lists to logical streaming replication into ETS.įuller details are here, with a couple of examples below: Column Lists create table t1 (id int,Ĭreate a publication p1, with a column list to reduce the number of columns that will be replicated: create publication p1 With pgmp configured for replication, the stanza. Thereafter, CRUD changes on the underlying PostgreSQL table will be automatically pushed to pgmp and reflected in the ETS table.Īn example of logical replication of a single table with a composite key: create table xyz (x integer, y integer, z integer, primary key (x, y)) Ĭreate a PostgreSQL publication for that table: create publication xyz for table xyz Introspection on the PostgreSQL metadata is done by pgmp so that x is used as the primary key for the replicated ETS table. The current state of the table is replicated into an ETS table also called xy: 1> ets:i(xy). Replication to ETS is a couple of steps: create table xy (x integer primary key, y text) Ĭreate a PostgreSQL publication for that table: create publication xy for table xy
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |