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

# 第 10 章 型別轉換

**目錄**

[10.1. 概觀](https://docs.postgresql.tw/19/the-sql-language/typeconv/typeconv-overview.md)

[10.2. 運算子](https://docs.postgresql.tw/19/the-sql-language/typeconv/typeconv-oper.md)

[10.3. 函式](https://docs.postgresql.tw/19/the-sql-language/typeconv/typeconv-func.md)

[10.4. 值的儲存](https://docs.postgresql.tw/19/the-sql-language/typeconv/typeconv-query.md)

[10.5. `UNION`、`CASE` 與相關結構](https://docs.postgresql.tw/19/the-sql-language/typeconv/typeconv-union-case.md)

[10.6. `SELECT` 輸出欄位](https://docs.postgresql.tw/19/the-sql-language/typeconv/typeconv-select.md)

SQL 陳述式可能有意或無意地要求在同一個運算式中混用不同資料型別。 PostgreSQL 提供廣泛的功能來評估混合型別的運算式。

許多情況下，使用者不需要瞭解型別轉換機制的細節。然而，PostgreSQL 所執行的 隱含型別轉換可能影響查詢結果。必要時，可以使用*明確*型別轉換來調整這些結果。

本章介紹 PostgreSQL 的型別轉換機制與慣例。特定資料型別及允許使用的函式和 運算子，請參閱[第 8 章](https://docs.postgresql.tw/19/the-sql-language/datatype.md)與[第 9 章](https://docs.postgresql.tw/19/the-sql-language/functions.md)的相關小節。

***

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


---

# 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/the-sql-language/typeconv.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.
