> 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/19/reference/sql-commands/sql-show.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# SHOW

### SHOW

SHOW — 顯示執行期參數的值

### 語法

```

SHOW name
SHOW ALL
```

### 說明

`SHOW` 會顯示執行期參數目前的設定值。這些變數可以透過 `SET` 陳述式設定，也可以編輯 `postgresql.conf` 組態檔、透過 `PGOPTIONS` 環境變數 （當使用 libpq 或以 libpq 為基礎的應用程式時）設定，或是在啟動 `postgres` 伺服器時透過命令列旗標設定。詳情請參閱[第 19 章](https://docs.postgresql.tw/19/server-administration/runtime-config.md)。

### 參數

*`name`*

執行期參數的名稱。可用的參數記載於[第 19 章](https://docs.postgresql.tw/19/server-administration/runtime-config.md)以及[SET](https://docs.postgresql.tw/19/reference/sql-commands/sql-set.md)參考頁面中。 此外，還有少數幾個參數只能顯示、不能設定：

* `SERVER_VERSION`

  顯示伺服器的版本號碼。
* `SERVER_ENCODING`

  顯示伺服器端的字元集編碼。目前這個參數只能顯示、不能設定， 因為編碼是在建立資料庫時就決定的。
* `IS_SUPERUSER`

  若目前角色具有超級使用者權限，則為真。

`ALL` : 顯示所有組態參數的值，並附上說明。

### 注意事項

函式 `current_setting` 會產生相同的輸出；請參閱 [9.28.1 節](https://docs.postgresql.tw/19/the-sql-language/functions/functions-admin/functions-admin-set.md#functions-admin-set)。 此外， [`pg_settings`](https://docs.postgresql.tw/19/internals/views/view-pg-settings.md) 系統檢視表也會產生相同的資訊。

### 範例

顯示參數 `DateStyle` 目前的設定：

```

SHOW DateStyle;
 DateStyle
-----------
 ISO, MDY
(1 row)
```

顯示參數 `geqo` 目前的設定：

```

SHOW geqo;
 geqo
------
 on
(1 row)
```

顯示所有設定：

```

SHOW ALL;
            name         | setting |                description
-------------------------+---------+-------------------------------------------------
 allow_system_table_mods | off     | Allows modifications of the structure of ...
    .
    .
    .
 xmloption               | content | Sets whether XML data in implicit parsing ...
 zero_damaged_pages      | off     | Continues processing past damaged page headers.
(196 rows)
```

### 相容性

`SHOW` 命令是 PostgreSQL 的擴充功能。

### 另請參閱

[SET](https://docs.postgresql.tw/19/reference/sql-commands/sql-set.md)、[RESET](https://docs.postgresql.tw/19/reference/sql-commands/sql-reset.md)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/sql-show.html)（原文版本：18.6；核對日期：2026-09-28）


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/19/reference/sql-commands/sql-show.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
