> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/14/server-administration/logical-replication/security.md).

# 30.7. 安全性

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

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

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

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

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

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

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.postgresql.tw/14/server-administration/logical-replication/security.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
