# Enhancement of Logical Replication

> Source chapter 3.3 for PostgreSQL 11.

---

LLMS index: [llms.txt](/en/llms.txt)

---

<div class="feature-source-note"><span class="feature-edition-badge">GA</span><span><strong>Source pages:</strong> PDF 35</span><span><a href="https://github.com/nori-shinoda/documents/blob/1773200c5362476c4a549222b7d17fa91f546cae/postgresql11_ga_new_features_en_20181022-1.pdf">Original PDF on GitHub</a></span></div>

<p class="feature-page-marker" id="pgfeat-11-logical-replication-pdf-page-35">PDF page 35</p>

The following features have been added to PostgreSQL 11 logical replication.

#### 3.3.1 TRUNCATE statement support {#pg11-3-3-1-truncate-statement-support}

The TRUNCATE statement executed on the PUBLICATION node in the Logical Replication environment now propagates to the SUBSCRIPTION node. Along with this, the specification to propagate TRUNCATE statement has been added to WITH clause of CREATE PUBLICATION and ALTER PUBLICATION statements.

**Example 40.** Specify TRUNCATE clause in CREATE PUBLICATION statement

```text
postgres=> CREATE PUBLICATION pub1 FOR TABLE data1
WITH (publish='INSERT, DELETE, UPDATE, TRUNCATE') ;
CREATE PUBLICATION
```

```text
DDLs other than TRUNCATE statement is not propagated.
```

#### 3.3.2 pg_replication_slot_advance function {#pg11-3-3-2-pg-replication-slot-advance-function}

When a conflict occurs in the logical replication environment in PostgreSQL 10, the start LSN of logical replication needs to be specified by executing the pg_replication_origin_advance function on the standby instance to resolve a conflict. In PostgreSQL 11, similar processing can now be executed in the PUBLICATION instance. Execute pg_replication_slot_advance function. This function specifies the replication slot name and LSN.

**Example 41.** Set replication start LSN to current LSN

```text
postgres=# SELECT
pg_replication_slot_advance('sub1', pg_current_wal_lsn()) ;
pg_replication_slot_advance
-----------------------------
 (sub1,0/5B63E18)
(1 row)
```
