# 31.7. 安全性

用於複寫連線的角色必須具有 REPLICATION 屬性（或者是超級使用者）。該角色的存取必須在 pg\_hba.conf 中設定，並且必須具有 LOGIN 屬性。

為了能夠複製初始資料表資料，用於複寫連線的角色必須在發佈的資料表上具有 SELECT 權限（或者是超級使用者）。

要建立發佈，使用者必須在資料庫中具有 CREATE 權限。

要將資料表加到發佈中，使用者必須擁有該資料表的所有權。要建立自動發佈所有資料表的發佈，使用者必須是超級使用者。

要建立訂閱，使用者必須是超級使用者。

訂閱 apply 程序將以超級使用者的權限在本地資料庫中運行。

權限僅在複寫連線開始時檢查一次。由於每個變更記錄都是從發佈者處讀取的，因此不會重新檢查，也不會在套用每個變更時重新檢查。


---

# 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.7.-an-quan-xing.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.
