# 31.4. 限制

邏輯複寫目前有以下限制或功能不足的地方。這些可能會在將來的版本中解決。

* 資料庫模式和 DDL 指令不會被複寫。初始模式可以使用 pg\_dump --schema-only 手動複寫。後續的結構變更需要手動保持同步。（但是，請注意，兩側的結構沒有必要完全相同。）當主要資料庫中的結構定義變更時，邏輯複寫是沒問題的：當發佈者上的結構産生變更並且複寫的資料開始到達訂閱戶但不符合資料表結構，複寫將産生錯誤，直到結構更新。在許多情況下，可以透過先將預定的架構變更套用於訂閱戶來避免間歇性的錯誤。
* 序列資料不會被複寫。序列支援的序列或識別欄位中的資料當然會作為資料表的一部分進行複寫，但序列本身仍然會顯示訂閱戶的初始值。如果使用者用作唯讀資料庫，那麼這通常不成問題。但是，如果打算對訂閱戶資料庫進行某種切換或故障轉移，則需要將序列更新為最新值，方法是複寫發佈者的目前資料（可能使用 pg\_dump）或設定對該資料表而言足夠高的值。
* TRUNCATE 指令不會被複寫。當然，這可以透過使用 DELETE 來解決。為了避免意外的 TRUNCATE 呼叫，您可以從資料表中撤銷 TRUNCATE 權限。
* Large objects（請參閱[第 34 章](/11/client-interfaces/34.-large-objects.md)）不會被複寫。除了將資料儲存在普通資料表中之外，沒有其他解決方法。
* 只能從基本資料表到基本資料表複寫。也就是說，發佈和訂閱端的資料表必須是普通資料表，而不是檢視表、具體化檢視表、分割資料表或外部資料表。對於分割資料表，您可以一對一複寫分割區的層次結構，但目前不能複寫到不同的分割區設定。嘗試複寫基本資料表以外的資料表將産生錯誤。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.postgresql.tw/11/server-administration/31.-luo-ji-fu-xie-logical-replication/31.4.-xian-zhi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
