# PostgreSQL 17 → 18 GUC 差异

> PG17 与 PG18 之间新增、boot 默认值变化和移除的核心配置参数。
---

> [!NOTE]
> **Fact。** 实测在档数从 380 变为 399；新增 21、boot 默认值变化 5、移除 2。

## 新增参数 {#added}

| 参数 | 类型 | Context | Boot 默认值 | 分类 |
| --- | --- | --- | --- | --- |
| [`autovacuum_vacuum_max_threshold`](/zh/parameters/autovacuum-vacuum-max-threshold/) | `integer` | `sighup` | `100000000` | Vacuuming / Automatic Vacuuming |
| [`autovacuum_worker_slots`](/zh/parameters/autovacuum-worker-slots/) | `integer` | `postmaster` | `16` | Vacuuming / Automatic Vacuuming |
| [`enable_distinct_reordering`](/zh/parameters/enable-distinct-reordering/) | `bool` | `user` | `on` | Query Tuning / Planner Method Configuration |
| [`enable_self_join_elimination`](/zh/parameters/enable-self-join-elimination/) | `bool` | `user` | `on` | Query Tuning / Planner Method Configuration |
| [`extension_control_path`](/zh/parameters/extension-control-path/) | `string` | `superuser` | `$system` | Client Connection Defaults / Other Defaults |
| [`file_copy_method`](/zh/parameters/file-copy-method/) | `enum` | `user` | `copy` | Resource Usage / Disk |
| [`idle_replication_slot_timeout`](/zh/parameters/idle-replication-slot-timeout/) | `integer` | `sighup` | `0 s` | Replication / Sending Servers |
| [`io_max_combine_limit`](/zh/parameters/io-max-combine-limit/) | `integer` | `postmaster` | `16 8kB` (128 KiB (16 × 8kB)) | Resource Usage / I/O |
| [`io_max_concurrency`](/zh/parameters/io-max-concurrency/) | `integer` | `postmaster` | `-1` | Resource Usage / I/O |
| [`io_method`](/zh/parameters/io-method/) | `enum` | `postmaster` | `worker` | Resource Usage / I/O |
| [`io_workers`](/zh/parameters/io-workers/) | `integer` | `sighup` | `3` | Resource Usage / I/O |
| [`log_lock_failures`](/zh/parameters/log-lock-failures/) | `bool` | `superuser` | `off` | Reporting and Logging / What to Log |
| [`max_active_replication_origins`](/zh/parameters/max-active-replication-origins/) | `integer` | `postmaster` | `10` | Replication / Subscribers |
| [`md5_password_warnings`](/zh/parameters/md5-password-warnings/) | `bool` | `user` | `on` | Connections and Authentication / Authentication |
| [`num_os_semaphores`](/zh/parameters/num-os-semaphores/) | `integer` | `internal` | `0` | Preset Options |
| [`oauth_validator_libraries`](/zh/parameters/oauth-validator-libraries/) | `string` | `sighup` | `""` (empty string) | Connections and Authentication / Authentication |
| [`ssl_groups`](/zh/parameters/ssl-groups/) | `string` | `sighup` | `X25519:prime256v1` | Connections and Authentication / SSL |
| [`ssl_tls13_ciphers`](/zh/parameters/ssl-tls13-ciphers/) | `string` | `sighup` | `""` (empty string) | Connections and Authentication / SSL |
| [`track_cost_delay_timing`](/zh/parameters/track-cost-delay-timing/) | `bool` | `superuser` | `off` | Statistics / Cumulative Query and Index Statistics |
| [`vacuum_max_eager_freeze_failure_rate`](/zh/parameters/vacuum-max-eager-freeze-failure-rate/) | `real` | `user` | `0.03` | Vacuuming / Freezing |
| [`vacuum_truncate`](/zh/parameters/vacuum-truncate/) | `bool` | `user` | `on` | Vacuuming / Default Behavior |
{.full-width}

## Boot 默认值变化 {#default-changes}

| 参数 | PG17 | PG18 | 分类 |
| --- | --- | --- | --- |
| [`effective_io_concurrency`](/zh/parameters/effective-io-concurrency/) | `1` | `16` | Resource Usage / I/O |
| [`log_connections`](/zh/parameters/log-connections/) | `off` | `""` (empty string) | Reporting and Logging / What to Log |
| [`maintenance_io_concurrency`](/zh/parameters/maintenance-io-concurrency/) | `10` | `16` | Resource Usage / I/O |
| [`server_version`](/zh/parameters/server-version/) | `17.11 (Debian 17.11-1.pgdg13+2)` | `18.6 (Debian 18.6-1.pgdg13+2)` | Preset Options |
| [`server_version_num`](/zh/parameters/server-version-num/) | `170011` | `180006` | Preset Options |
{.full-width}

## 移除参数 {#removed}

| 参数 | 最后类型 | Context | 最后 Boot 默认值 | 分类 |
| --- | --- | --- | --- | --- |
| [`extension_destdir`](/zh/parameters/extension-destdir/) | `string` | `superuser` | `""` (empty string) | File Locations |
| [`ssl_ecdh_curve`](/zh/parameters/ssl-ecdh-curve/) | `string` | `sighup` | `prime256v1` | Connections and Authentication / SSL |
{.full-width}

## 计算方法 {#method}

三张清单直接比较固定环境中的 PG17 与 PG18 `pg_settings` 快照。默认值变化使用 `boot_val` 与 `unit` 的组合；`setting` 不参与判定，以免把 `initdb` 生成值误当作编译时默认值。

- [机器可读差异数据](/data/diffs.json)
- [完整 GUC JSONL](/data/guc.jsonl)
