|
299 | 299 | </para>
|
300 | 300 | </sect1>
|
301 | 301 |
|
| 302 | + <sect1 id="logical-replication-restrictions"> |
| 303 | + <title>Restrictions</title> |
| 304 | + |
| 305 | + <para> |
| 306 | + Logical replication currently has the following restrictions or missing |
| 307 | + functionality. These might be addressed in future releases. |
| 308 | + </para> |
| 309 | + |
| 310 | + <itemizedlist> |
| 311 | + <listitem> |
| 312 | + <para> |
| 313 | + The database schema and DDL commands are not replicated. The initial |
| 314 | + schema can be copied by hand using <literal>pg_dump |
| 315 | + --schema-only</literal>. Subsequent schema changes would need to be kept |
| 316 | + in sync manually. (Note, however, that there is no need for the schemas |
| 317 | + to be absolutely the same on both sides.) Logical replication is robust |
| 318 | + when schema definitions change in a live database: When the schema is |
| 319 | + changed on the publisher and replicated data starts arriving at the |
| 320 | + subscriber but does not fit into the table schema, replication will error |
| 321 | + until the schema is updated. In many cases, intermittent errors can be |
| 322 | + avoided by applying additive schema changes to the subscriber first. |
| 323 | + </para> |
| 324 | + </listitem> |
| 325 | + |
| 326 | + <listitem> |
| 327 | + <para> |
| 328 | + Sequence data is not replicated. The data in serial or identity columns |
| 329 | + backed by sequences will of course be replicated as part of the table, |
| 330 | + but the sequence itself would still show the start value on the |
| 331 | + subscriber. If the subscriber is used as a read-only database, then this |
| 332 | + should typically not be a problem. If, however, some kind of switchover |
| 333 | + or failover to the subscriber database is intended, then the sequences |
| 334 | + would need to be updated to the latest values, either by copying the |
| 335 | + current data from the publisher (perhaps |
| 336 | + using <command>pg_dump</command>) or by determining a sufficiently high |
| 337 | + value from the tables themselves. |
| 338 | + </para> |
| 339 | + </listitem> |
| 340 | + |
| 341 | + <listitem> |
| 342 | + <para> |
| 343 | + <command>TRUNCATE</command> commands are not replicated. This can, of |
| 344 | + course, be worked around by using <command>DELETE</command> instead. To |
| 345 | + avoid accidental <command>TRUNCATE</command> invocations, you can revoke |
| 346 | + the <literal>TRUNCATE</literal> privilege from tables. |
| 347 | + </para> |
| 348 | + </listitem> |
| 349 | + |
| 350 | + <listitem> |
| 351 | + <para> |
| 352 | + Large objects (see <xref linkend="largeobjects">) are not replicated. |
| 353 | + There is no workaround for that, other than storing data in normal |
| 354 | + tables. |
| 355 | + </para> |
| 356 | + </listitem> |
| 357 | + |
| 358 | + <listitem> |
| 359 | + <para> |
| 360 | + Replication is only possible from base tables to base tables. That is, |
| 361 | + the tables on the publication and on the subscription side must be normal |
| 362 | + tables, not views, materialized views, partition root tables, or foreign |
| 363 | + tables. In the case of partitions, you can therefore replicate a |
| 364 | + partition hierarchy one-to-one, but you cannot currently replicate to a |
| 365 | + differently partitioned setup. Attempts to replicate tables other than |
| 366 | + base tables will result in an error. |
| 367 | + </para> |
| 368 | + </listitem> |
| 369 | + </itemizedlist> |
| 370 | + </sect1> |
| 371 | + |
302 | 372 | <sect1 id="logical-replication-architecture">
|
303 | 373 | <title>Architecture</title>
|
304 | 374 |
|
|
0 commit comments