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

# 3.1. 簡介

### 3.1. 簡介 [#](#tutorial-advanced-intro) <a href="#tutorial-advanced-intro" id="tutorial-advanced-intro"></a>

前一章介紹了使用 SQL 在 PostgreSQL 中儲存及存取資料的基礎。現在我們將討論一些更進階的 SQL 功能，讓管理更簡單，並防止資料遺失或損毀。最後，我們會介紹一些 PostgreSQL 的擴充功能。

本章有時會引用[第 2 章](https://docs.postgresql.tw/19/tutorial/tutorial-sql.md)的範例並加以修改或改善，因此先讀過該章會有所幫助。本章部分範例也收錄在教學目錄的 `advanced.sql` 中。該檔案另包含一些要載入的範例資料，此處不再重複列出。（檔案的使用方式請參閱[第 2.1 節](https://docs.postgresql.tw/19/tutorial/tutorial-sql/tutorial-sql-intro.md)。）

***

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


---

# 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/tutorial/tutorial-advanced/tutorial-advanced-intro.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.
