4 Logical replication currently has the following restrictions or missing
5 functionality. These might be addressed in future releases.
6 * The database schema and DDL commands are not replicated. The
7 initial schema can be copied by hand using pg_dump --schema-only.
8 Subsequent schema changes would need to be kept in sync manually.
9 (Note, however, that there is no need for the schemas to be
10 absolutely the same on both sides.) Logical replication is robust
11 when schema definitions change in a live database: When the schema
12 is changed on the publisher and replicated data starts arriving at
13 the subscriber but does not fit into the table schema, replication
14 will error until the schema is updated. In many cases, intermittent
15 errors can be avoided by applying additive schema changes to the
17 * Sequence data is not replicated. The data in serial or identity
18 columns backed by sequences will of course be replicated as part of
19 the table, but the sequence itself would still show the start value
20 on the subscriber. If the subscriber is used as a read-only
21 database, then this should typically not be a problem. If, however,
22 some kind of switchover or failover to the subscriber database is
23 intended, then the sequences would need to be updated to the latest
24 values, either by copying the current data from the publisher
25 (perhaps using pg_dump) or by determining a sufficiently high value
26 from the tables themselves.
27 * Replication of TRUNCATE commands is supported, but some care must
28 be taken when truncating groups of tables connected by foreign
29 keys. When replicating a truncate action, the subscriber will
30 truncate the same group of tables that was truncated on the
31 publisher, either explicitly specified or implicitly collected via
32 CASCADE, minus tables that are not part of the subscription. This
33 will work correctly if all affected tables are part of the same
34 subscription. But if some tables to be truncated on the subscriber
35 have foreign-key links to tables that are not part of the same (or
36 any) subscription, then the application of the truncate action on
37 the subscriber will fail.
38 * Large objects (see Chapter 33) are not replicated. There is no
39 workaround for that, other than storing data in normal tables.
40 * Replication is only supported by tables, including partitioned
41 tables. Attempts to replicate other types of relations, such as
42 views, materialized views, or foreign tables, will result in an
44 * When replicating between partitioned tables, the actual replication
45 originates, by default, from the leaf partitions on the publisher,
46 so partitions on the publisher must also exist on the subscriber as
47 valid target tables. (They could either be leaf partitions
48 themselves, or they could be further subpartitioned, or they could
49 even be independent tables.) Publications can also specify that
50 changes are to be replicated using the identity and schema of the
51 partitioned root table instead of that of the individual leaf
52 partitions in which the changes actually originate (see
53 publish_via_partition_root parameter of CREATE PUBLICATION).
54 * When using REPLICA IDENTITY FULL on published tables, it is
55 important to note that the UPDATE and DELETE operations cannot be
56 applied to subscribers if the tables include attributes with
57 datatypes (such as point or box) that do not have a default
58 operator class for B-tree or Hash. However, this limitation can be
59 overcome by ensuring that the table has a primary key or replica
60 identity defined for it.