PostgreSQL 10
已停止支持 · 记录构建 10.23 · 2022-11-10
此大版本已停止支持,相关记录用于查阅历史;没有更新的安全记录不代表仍可安全运行。
- 首次正式发布
- 2017-10-05
- 支持结束
- 2022-11-10
- 已收录发布版本
- 24
- 原始发布说明条目
- 1140
手册与来源
PostgreSQL 10 本站手册 · 已加载 1011 页。
手册加载时间:2026-09-27T00:10:45.258078。
发布说明快照:2026-09-26。安全证据快照:2026-09-26。PDF 链接按本地文件是否存在提供,历史版本的语言与 HTML 手册可能不同。生命周期参见官方版本政策。
升级注意事项
跨大版本升级需要导出/恢复或 pg_upgrade 等迁移方式,应阅读沿途大版本的发布说明与目标版本手册。小版本更新也可能要求额外操作,请核对对应发布的迁移说明。官方升级政策。
10.0 的原始迁移说明
对于希望从任何先前版本迁移数据的用户,需要使用pg_dumpall进行导出/恢复,或使用pg_upgrade或逻辑复制。有关迁移到新主版本的一般信息,请参见第 18.6 节。
版本 10 包含许多可能影响与先前版本兼容性的变更。请注意以下不兼容性:
发布历史
每次发布的原始变更均独立保留。CVE 数量表示发布说明中的提及,可能包含后续纠正,不等于本次新修复漏洞数。
| 版本 | 日期/快照截止时间 | 全部变化 | BUG 修复 | 迁移条目 | 提及 CVE |
|---|---|---|---|---|---|
| 10.23 | 2022-11-10 | 29 | 13 | 0 | 0 |
| 10.22 | 2022-08-11 | 34 | 11 | 0 | 2 |
| 10.21 | 2022-05-12 | 29 | 14 | 0 | 1 |
| 10.20 | 2022-02-10 | 28 | 13 | 0 | 0 |
| 10.19 | 2021-11-11 | 50 | 21 | 0 | 2 |
| 10.18 | 2021-08-12 | 52 | 17 | 0 | 2 |
| 10.17 | 2021-05-13 | 30 | 15 | 0 | 2 |
| 10.16 | 2021-02-11 | 40 | 18 | 0 | 0 |
| 10.15 | 2020-11-12 | 40 | 14 | 0 | 3 |
| 10.14 | 2020-08-13 | 35 | 17 | 0 | 3 |
| 10.13 | 2020-05-14 | 45 | 19 | 0 | 0 |
| 10.12 | 2020-02-13 | 46 | 24 | 0 | 1 |
| 10.11 | 2019-11-14 | 59 | 26 | 0 | 0 |
| 10.10 | 2019-08-08 | 31 | 13 | 0 | 2 |
| 10.9 | 2019-06-20 | 22 | 13 | 0 | 1 |
| 10.8 | 2019-05-09 | 43 | 27 | 0 | 2 |
| 10.7 | 2019-02-14 | 54 | 26 | 0 | 0 |
| 10.6 | 2018-11-08 | 71 | 34 | 0 | 1 |
| 10.5 | 2018-08-09 | 47 | 22 | 0 | 2 |
| 10.4 | 2018-05-10 | 53 | 30 | 0 | 1 |
| 10.3 | 2018-03-01 | 11 | 6 | 0 | 1 |
| 10.2 | 2018-02-08 | 65 | 33 | 0 | 2 |
| 10.1 | 2017-11-09 | 37 | 18 | 0 | 3 |
| 10.0 | 2017-10-05 | 189 | 2 | 27 | 0 |
首次发布变化
10.0 的原始条目,包含功能和兼容性变化。类别用于浏览,不是上游原始分类。
匹配 189 / 189 条原始变更。
使用 pg_upgrade 从任何先前的 PostgreSQL 大版本升级后,必须重建 hash 索引 · 兼容性变化 · 迁移说明
使用 pg_upgrade 从任何先前的 PostgreSQL 大版本升级后,必须重建 hash 索引(Mithun Cy,Robert Haas,Amit Kapila)
hash 索引的重大改进使这一要求成为必要。pg_upgrade 会创建一个脚本来协助完成此操作。
原始发布条目 ·
10.0/migration/001重命名名称中引用 “xlog” 的 SQL 函数、工具和选项,改用 “wal” · 兼容性变化 · 迁移说明
重命名名称中引用 “xlog” 的 SQL 函数、工具和选项,改用 “wal”(Robert Haas)
例如,
pg_switch_xlog()改为pg_switch_wal(),pg_receivexlog 改为 pg_receivewal,--xlogdir改为--waldir。这是为了与pg_xlog目录名的变更保持一致;总体而言,所有面向用户的位置都不再使用 “xlog” 这一术语。原始发布条目 ·
10.0/migration/003重命名与 WAL 相关的函数和视图,使用 lsn 代替 location · 兼容性变化 · 迁移说明
重命名与 WAL 相关的函数和视图,使用
lsn代替location(David Rowley)以前,这两种术语的使用并不一致。
原始发布条目 ·
10.0/migration/004更改查询 SELECT 列表中集合返回函数的实现 · 兼容性变化 · 迁移说明
更改查询
SELECT列表中集合返回函数的实现(Andres Freund)现在,集合返回函数会在
SELECT列表中的标量表达式求值之前求值,效果类似于将它们放在LATERAL FROM子句项中。这使存在多个集合返回函数时的语义更合理。如果它们返回的行数不同,会通过补充空值将较短的结果扩展到最长结果的长度。以前,各个结果会循环产生,直到它们同时结束,产生的行数等于各函数周期的最小公倍数。此外,现在禁止在CASE和COALESCE结构内使用集合返回函数。更多信息参见第 37.4.8 节。原始发布条目 ·
10.0/migration/005在 UPDATE ... SET (column_list) = row_constructor 中使用标准行构造器语法 · 兼容性变化 · 迁移说明
在
UPDATE ... SET (中使用标准行构造器语法(Tom Lane)column_list) =row_constructor现在,
row_constructor可以以关键字ROW开头;以前必须省略该关键字。如果column_list中只有一个列名,则row_constructor现在必须使用ROW关键字,否则它就不是有效的行构造器,而只是带括号的表达式。此外,row_constructor内出现的现在会展开为多列,与table_name.*row_constructor在其他场景中的用法一致。原始发布条目 ·
10.0/migration/006当 ALTER TABLE ... ADD PRIMARY KEY 将列标记为 NOT NULL 时,此变更现在也会传播到继承子表 · 兼容性变化 · 迁移说明
当
ALTER TABLE ... ADD PRIMARY KEY将列标记为NOT NULL时,此变更现在也会传播到继承子表(Michael Paquier)原始发布条目 ·
10.0/migration/007防止语句级触发器在每条语句中触发多次 · 兼容性变化 · 迁移说明
防止语句级触发器在每条语句中触发多次(Tom Lane)
如果可写 CTE 更新的表也被包含它的语句或另一个可写 CTE 更新,
BEFORE STATEMENT或AFTER STATEMENT触发器就会触发多次。此外,如果受外键实施动作(如ON DELETE CASCADE)影响的表上存在语句级触发器,它们可能在每条外层 SQL 语句中触发多次。这违反 SQL 标准,因此予以更改。原始发布条目 ·
10.0/migration/008将序列的元数据字段移入新的 pg_sequence 系统目录 · 兼容性变化 · 迁移说明
将序列的元数据字段移入新的
pg_sequence系统目录(Peter Eisentraut)序列关系现在只存储
nextval()可以修改的字段,即last_value、log_cnt和is_called。起始值和增量等其他序列属性保存在pg_sequence目录的对应行中。ALTER SEQUENCE的更新现在完全具有事务性,这意味着序列会被锁定到提交为止。nextval()和setval()函数仍然不具有事务性。此项修改引入的主要不兼容之处在于,从序列关系中查询时,现在只会返回上述三个字段。要获取序列的其他属性,应用必须查询
pg_sequence。新的系统视图pg_sequences也可用于此目的;它提供的列名与现有代码更为兼容。此外,为
SERIAL列创建的序列现在生成 32 位正值,而以前的版本生成 64 位值。如果这些值只存储在列中,则没有可见影响。psql 的
\d命令针对序列的输出也经过了重新设计。原始发布条目 ·
10.0/migration/009使 pg_basebackup 默认以流方式传输恢复备份所需的 WAL · 兼容性变化 · 迁移说明
使 pg_basebackup 默认以流方式传输恢复备份所需的 WAL(Magnus Hagander)
这将 pg_basebackup 的
-X/--wal-method默认值改为stream。新增选项值none,用于复现旧行为。pg_basebackup 的-x选项已移除(请改用-X fetch)。原始发布条目 ·
10.0/migration/010更改逻辑复制使用 pg_hba.conf 的方式 · 兼容性变化 · 迁移说明
更改逻辑复制使用
pg_hba.conf的方式(Peter Eisentraut)在以前的版本中,逻辑复制连接要求数据库列使用
replication关键字。从此版本起,逻辑复制匹配包含数据库名或all等关键字的普通条目。物理复制继续使用replication关键字。由于内置逻辑复制是此版本的新功能,这项变更只影响第三方逻辑复制插件的用户。原始发布条目 ·
10.0/migration/011将服务器参数log_directory的默认值从 pg_log 改为 log · 兼容性变化 · 迁移说明
将服务器参数log_directory的默认值从
pg_log改为log(Andreas Karlsson)原始发布条目 ·
10.0/migration/013增加配置选项ssl_dh_params_file,用于指定自定义 OpenSSL DH 参数的文件名 · 兼容性变化 · 迁移说明
增加配置选项ssl_dh_params_file,用于指定自定义 OpenSSL DH 参数的文件名(Heikki Linnakangas)
这取代了硬编码且未记录在文档中的文件名
dh1024.pem。注意,默认不再检查dh1024.pem;如果要使用自定义 DH 参数,必须设置此选项。原始发布条目 ·
10.0/migration/014将 OpenSSL 临时 DH 密码套件使用的默认 DH 参数长度增加到 2048 位 · 兼容性变化 · 迁移说明
将 OpenSSL 临时 DH 密码套件使用的默认 DH 参数长度增加到 2048 位(Heikki Linnakangas)
编译内置的 DH 参数长度已从 1024 位增加到 2048 位,使 DH 密钥交换更能抵御暴力攻击。但是,某些旧 SSL 实现,尤其是 Java Runtime Environment 6 的某些修订版,不接受超过 1024 位的 DH 参数,因此无法通过 SSL 连接。如果必须支持此类旧客户端,可以使用自定义的 1024 位 DH 参数代替编译内置的默认值。参见ssl_dh_params_file。
原始发布条目 ·
10.0/migration/015移除在服务器上存储未加密密码的能力 · 兼容性变化 · 迁移说明
移除在服务器上存储未加密密码的能力(Heikki Linnakangas)
服务器参数password_encryption不再支持
off或plain。CREATE/ALTER USER ... PASSWORD不再支持UNENCRYPTED选项。同样,createuser 的--unencrypted选项也已移除。从旧版本迁移来的未加密密码在此版本中会以加密形式存储。password_encryption的默认设置仍为md5。原始发布条目 ·
10.0/migration/016增加服务器参数min_parallel_table_scan_size和min_parallel_index_scan_size,用于控制并行查询 · 兼容性变化 · 迁移说明
增加服务器参数min_parallel_table_scan_size和min_parallel_index_scan_size,用于控制并行查询(Amit Kapila,Robert Haas)
这两个参数取代了被认为过于笼统的
min_parallel_relation_size。原始发布条目 ·
10.0/migration/017不再将shared_preload_libraries及相关服务器参数中未加引号的文本转为小写 · 兼容性变化 · 迁移说明
不再将shared_preload_libraries及相关服务器参数中未加引号的文本转为小写(QL Zhuo)
这些设置实际上是文件名列表,但以前被当作 SQL 标识符列表处理,而两者的解析规则不同。
原始发布条目 ·
10.0/migration/018移除服务器参数 sql_inheritance · 兼容性变化 · 迁移说明
移除服务器参数
sql_inheritance(Robert Haas)将此设置改为非默认值,会使引用父表的查询不包含子表。但是,SQL 标准要求包含子表,而且这从 PostgreSQL 7.1 起就是默认行为。
原始发布条目 ·
10.0/migration/019允许将多维数组传给 PL/Python 函数,并以嵌套 Python 列表形式返回 · 兼容性变化 · 迁移说明
允许将多维数组传给 PL/Python 函数,并以嵌套 Python 列表形式返回(Alexey Grishchenko,Dave Cramer,Heikki Linnakangas)
此功能需要对 PL/Python 中复合类型数组的处理进行一项不向后兼容的更改。以前,可以通过编写如
[[col1, col2], [col1, col2]]的形式返回复合值数组;但现在这会被解释为二维数组。为消除歧义,数组中的复合类型现在必须写成 Python 元组,不能写成列表;也就是说,应改为[(col1, col2), (col1, col2)]。原始发布条目 ·
10.0/migration/020移除 PL/Tcl 的“模块”自动加载功能 · 兼容性变化 · 迁移说明
移除 PL/Tcl 的“模块”自动加载功能(Tom Lane)
此功能已由新的服务器参数pltcl.start_proc和pltclu.start_proc取代,它们更易使用,也更类似于其他 PL 提供的功能。
原始发布条目 ·
10.0/migration/021移除 pg_dump/pg_dumpall 对从 8.0 之前的服务器转储的支持 · 兼容性变化 · 迁移说明
移除 pg_dump/pg_dumpall 对从 8.0 之前的服务器转储的支持(Tom Lane)
需要从 8.0 之前的服务器转储的用户,必须使用 PostgreSQL 9.6 或更早版本的转储程序。生成的输出仍应能成功载入较新的服务器。
原始发布条目 ·
10.0/migration/022移除对浮点时间戳和时间间隔的支持 · 兼容性变化 · 迁移说明
移除对浮点时间戳和时间间隔的支持(Tom Lane)
这移除了 configure 的
--disable-integer-datetimes选项。浮点时间戳的优势很少,而且从 PostgreSQL 8.3 起就不再是默认选择。原始发布条目 ·
10.0/migration/023移除服务器对客户端/服务器协议 1.0 版的支持 · 兼容性变化 · 迁移说明
移除服务器对客户端/服务器协议 1.0 版的支持(Tom Lane)
从 PostgreSQL 6.3 起,客户端就不再支持此协议。
原始发布条目 ·
10.0/migration/024移除 contrib/tsearch2 模块 · 兼容性变化 · 迁移说明
移除
contrib/tsearch2模块(Robert Haas)此模块用于兼容 PostgreSQL 8.3 之前的发行版所附带的全文检索版本。
原始发布条目 ·
10.0/migration/025移除 createlang 和 droplang 命令行应用程序 · 兼容性变化 · 迁移说明
移除 createlang 和 droplang 命令行应用程序(Peter Eisentraut)
它们从 PostgreSQL 9.1 起就已弃用。请改为直接使用
CREATE EXTENSION和DROP EXTENSION。原始发布条目 ·
10.0/migration/026移除对版本 0 函数调用约定的支持 · 兼容性变化 · 迁移说明
移除对版本 0 函数调用约定的支持(Andres Freund)
提供 C 编写函数的扩展现在必须遵循版本 1 调用约定。版本 0 从 2001 年起就已弃用。
原始发布条目 ·
10.0/migration/027支持并行 B-树索引扫描 · 新功能
支持并行 B-树索引扫描(Rahila Syed,Amit Kapila,Robert Haas,Rafia Sabih)
此变更允许不同的并行工作进程搜索 B-树索引页。
原始发布条目 ·
10.0/changes/001增加服务器参数max_parallel_workers,用于限制可用于查询并行处理的工作进程数量 · 新功能
增加服务器参数max_parallel_workers,用于限制可用于查询并行处理的工作进程数量(Julien Rouhaud)
可以将此参数设为低于max_worker_processes的值,为并行查询以外的用途预留工作进程。
原始发布条目 ·
10.0/changes/007将max_parallel_workers_per_gather的默认设置改为 2,以默认启用并行处理。 · 新功能
将max_parallel_workers_per_gather的默认设置改为
2,以默认启用并行处理。原始发布条目 ·
10.0/changes/008为 hash 索引增加预写式日志支持 · 新功能
为 hash 索引增加预写式日志支持(Amit Kapila)
这使 hash 索引能够安全应对崩溃并支持复制。以前关于其使用的警告消息已移除。
原始发布条目 ·
10.0/changes/009为 INET 和 CIDR 数据类型增加 SP-GiST 索引支持 · 新功能
为
INET和CIDR数据类型增加 SP-GiST 索引支持(Emre Hasegeli)原始发布条目 ·
10.0/changes/011增加一个选项,允许更积极地生成 BRIN 索引摘要 · 新功能
增加一个选项,允许更积极地生成 BRIN 索引摘要(Álvaro Herrera)
新增的
CREATE INDEX选项可在创建新页范围时,自动为前一个 BRIN 页范围生成摘要。原始发布条目 ·
10.0/changes/012增加用于移除和重新添加 BRIN 索引范围的 BRIN 摘要的函数 · 新功能
增加用于移除和重新添加 BRIN 索引范围的 BRIN 摘要的函数(Álvaro Herrera)
新的 SQL 函数
brin_summarize_range()更新指定范围的 BRIN 索引摘要,而brin_desummarize_range()将其移除。这有助于更新因UPDATE和DELETE而缩小的范围的摘要。原始发布条目 ·
10.0/changes/013提高判断 BRIN 索引扫描是否有益的准确性 · 新功能
提高判断 BRIN 索引扫描是否有益的准确性(David Rowley,Emre Hasegeli)
原始发布条目 ·
10.0/changes/014通过更有效地复用索引空间,加快 GiST 的插入和更新 · 性能改进
通过更有效地复用索引空间,加快 GiST 的插入和更新(Andrey Borodin)
原始发布条目 ·
10.0/changes/015减少更改表参数所需的锁定 · 新功能
减少更改表参数所需的锁定(Simon Riggs,Fabrízio Mello)
例如,现在可以使用更轻量的锁来更改表的effective_io_concurrency设置。
原始发布条目 ·
10.0/changes/017允许调整谓词锁升级阈值 · 新功能
允许调整谓词锁升级阈值(Dagfinn Ilmari Mannsåker)
现在可以通过两个新的服务器参数max_pred_locks_per_relation和max_pred_locks_per_page控制锁升级。
原始发布条目 ·
10.0/changes/018增加多列优化器统计信息,用于计算相关比率和不同值数量 · 新功能
增加多列优化器统计信息,用于计算相关比率和不同值数量(Tomas Vondra,David Rowley,Álvaro Herrera)
新命令包括
CREATE STATISTICS、ALTER STATISTICS和DROP STATISTICS。此功能有助于估算查询内存用量,以及组合各列的统计信息。原始发布条目 ·
10.0/changes/019提高受行级安全限制影响的查询的性能 · 性能改进
提高受行级安全限制影响的查询的性能(Tom Lane)
优化器现在更清楚可以将 RLS 过滤条件放在何处,从而在安全实施 RLS 条件的同时生成更好的计划。
原始发布条目 ·
10.0/changes/020加快使用 numeric 类型算术计算累计和的聚合函数,包括 SUM()、AVG() 和 STDDEV() 的某些变体 · 性能改进
加快使用
numeric类型算术计算累计和的聚合函数,包括SUM()、AVG()和STDDEV()的某些变体(Heikki Linnakangas)原始发布条目 ·
10.0/changes/021通过使用基数树提升字符编码转换性能 · 性能改进
通过使用基数树提升字符编码转换性能(Kyotaro Horiguchi,Heikki Linnakangas)
原始发布条目 ·
10.0/changes/022降低查询执行期间的表达式求值开销和计划节点调用开销 · 性能改进
降低查询执行期间的表达式求值开销和计划节点调用开销(Andres Freund)
这对于处理大量行的查询尤其有帮助。
原始发布条目 ·
10.0/changes/023增加默认监控角色 · 新功能
增加默认监控角色(Dave Page)
新角色
pg_monitor、pg_read_all_settings、pg_read_all_stats和pg_stat_scan_tables可以简化权限配置。原始发布条目 ·
10.0/changes/029在 REFRESH MATERIALIZED VIEW 期间正确更新统计信息收集器 · 新功能
在
REFRESH MATERIALIZED VIEW期间正确更新统计信息收集器(Jim Mlodgenski)原始发布条目 ·
10.0/changes/030更改log_line_prefix的默认值,使 postmaster 日志输出的每一行都包含当前时间戳(含毫秒)和进程 ID · 新功能
更改log_line_prefix的默认值,使 postmaster 日志输出的每一行都包含当前时间戳(含毫秒)和进程 ID(Christoph Berg)
以前的默认值是空前缀。
原始发布条目 ·
10.0/changes/031增加返回日志和 WAL 目录内容的函数 · 新功能
增加返回日志和 WAL 目录内容的函数(Dave Page)
新增函数为
pg_ls_logdir()和pg_ls_waldir(),拥有适当权限的非超级用户也可以执行它们。原始发布条目 ·
10.0/changes/032增加函数 pg_current_logfile(),用于读取日志收集器当前的 stderr 和 csvlog 输出文件名 · 新功能
增加函数
pg_current_logfile(),用于读取日志收集器当前的 stderr 和 csvlog 输出文件名(Gilles Darold)原始发布条目 ·
10.0/changes/033在 postmaster 启动期间,在服务器日志中报告每个监听套接字的地址和端口号 · 新功能
在 postmaster 启动期间,在服务器日志中报告每个监听套接字的地址和端口号(Tom Lane)
此外,在记录绑定监听套接字失败时,包含尝试绑定的具体地址。
原始发布条目 ·
10.0/changes/034减少关于启动器子进程启动和停止的冗余日志 · 新功能
减少关于启动器子进程启动和停止的冗余日志(Tom Lane)
这些消息现在使用
DEBUG1级别。原始发布条目 ·
10.0/changes/035减少log_min_messages所控制的较低编号调试级别的消息详细程度 · 新功能
减少log_min_messages所控制的较低编号调试级别的消息详细程度(Robert Haas)
这也改变了client_min_messages各调试级别的详细程度。
原始发布条目 ·
10.0/changes/036增加 pg_stat_activity 对底层等待状态的报告 · 新功能
增加
pg_stat_activity对底层等待状态的报告(Michael Paquier,Robert Haas,Rushabh Lathia)此变更允许报告大量底层等待条件,包括锁存器等待、文件读取/写入/fsync、客户端读取/写入以及同步复制。
原始发布条目 ·
10.0/changes/037在 pg_stat_activity 中显示辅助进程、后台工作进程和 WAL 发送进程进程 · 新功能
在
pg_stat_activity中显示辅助进程、后台工作进程和 WAL 发送进程进程(Kuntal Ghosh,Michael Paquier)这简化了监控。新列
backend_type用于标识进程类型。原始发布条目 ·
10.0/changes/038允许 pg_stat_activity 显示并行工作进程正在执行的 SQL 查询 · 新功能
允许
pg_stat_activity显示并行工作进程正在执行的 SQL 查询(Rafia Sabih)原始发布条目 ·
10.0/changes/039将 pg_stat_activity.wait_event_type 的值 LWLockTranche 和 LWLockNamed 重命名为 LWLock · 新功能
将
pg_stat_activity.wait_event_type的值LWLockTranche和LWLockNamed重命名为LWLock(Robert Haas)这使输出更一致。
原始发布条目 ·
10.0/changes/040增加对使用 SCRAM-SHA-256 协商和存储密码的支持 · 新功能
增加对使用 SCRAM-SHA-256 协商和存储密码的支持(Michael Paquier,Heikki Linnakangas)
这比现有的
md5协商和存储方式更安全。原始发布条目 ·
10.0/changes/041将服务器参数password_encryption从 boolean 改为 enum · 新功能
将服务器参数password_encryption从
boolean改为enum(Michael Paquier)这是支持更多密码 hash 选项所必需的。
原始发布条目 ·
10.0/changes/042增加视图 pg_hba_file_rules,用于显示 pg_hba.conf 的内容 · 新功能
增加视图
pg_hba_file_rules,用于显示pg_hba.conf的内容(Haribabu Kommi)它显示的是文件内容,而非当前生效的设置。
原始发布条目 ·
10.0/changes/043支持多个 RADIUS 服务器 · 新功能
支持多个 RADIUS 服务器(Magnus Hagander)
所有与 RADIUS 相关的参数现在都使用复数形式,并支持以逗号分隔的服务器列表。
原始发布条目 ·
10.0/changes/044允许在重新加载配置时更新 SSL 配置 · 新功能
允许在重新加载配置时更新 SSL 配置(Andreas Karlsson,Tom Lane)
这允许通过使用
pg_ctl reload、SELECT pg_reload_conf()或发送SIGHUP信号来重新配置 SSL,无需重启服务器。但是,如果服务器的 SSL 密钥需要口令,则无法重新加载 SSL 配置,因为无法再次提示输入口令。在这种情况下,原始配置会在 postmaster 的整个生命周期内生效。原始发布条目 ·
10.0/changes/045使bgwriter_lru_maxpages的最大值实际上不再受限 · 新功能
使bgwriter_lru_maxpages的最大值实际上不再受限(Jim Nasby)
原始发布条目 ·
10.0/changes/046创建文件或解除文件链接后,对其父目录执行 fsync · 新功能
创建文件或解除文件链接后,对其父目录执行 fsync(Michael Paquier)
这降低了断电后丢失数据的风险。
原始发布条目 ·
10.0/changes/047防止在其他方面处于空闲状态的系统上执行不必要的检查点和 WAL 归档 · 新功能
防止在其他方面处于空闲状态的系统上执行不必要的检查点和 WAL 归档(Michael Paquier)
原始发布条目 ·
10.0/changes/048增加服务器参数wal_consistency_checking,用于向 WAL 添加可在备库上进行合理性检查的详细信息 · 新功能
增加服务器参数wal_consistency_checking,用于向 WAL 添加可在备库上进行合理性检查的详细信息(Kuntal Ghosh,Robert Haas)
任何合理性检查失败都会在备库上产生致命错误。
原始发布条目 ·
10.0/changes/049将可配置的最大 WAL 段大小增加到 1 GB · 新功能
将可配置的最大 WAL 段大小增加到 1 GB(Beena Emerson)
较大的 WAL 段可以减少archive_command调用次数,以及需要管理的 WAL 文件数量。
原始发布条目 ·
10.0/changes/050允许等待备库的提交确认,而不受其在synchronous_standby_names中出现顺序的影响 · 新功能
允许等待备库的提交确认,而不受其在synchronous_standby_names中出现顺序的影响(Masahiko Sawada)
以前,服务器始终等待
synchronous_standby_names中最先出现的活动备库。新的synchronous_standby_names关键字ANY允许等待任意指定数量的备库,而不考虑其排列顺序。这称为法定人数提交。原始发布条目 ·
10.0/changes/052减少执行流式备份和复制所需的配置变更 · 新功能
减少执行流式备份和复制所需的配置变更(Magnus Hagander,Dang Minh Huong)
具体而言,更改了wal_level、max_wal_senders、max_replication_slots和hot_standby的默认值,使其开箱即可用于这些场景。
原始发布条目 ·
10.0/changes/053在 pg_hba.conf 中默认启用来自 localhost 连接的复制 · 新功能
在
pg_hba.conf中默认启用来自 localhost 连接的复制(Michael Paquier)以前,
pg_hba.conf中的复制连接行默认被注释掉。这对于 pg_basebackup 尤其有用。原始发布条目 ·
10.0/changes/054向 pg_stat_replication 添加列,以报告复制延迟时间 · 新功能
向
pg_stat_replication添加列,以报告复制延迟时间(Thomas Munro)新列为
write_lag、flush_lag和replay_lag。原始发布条目 ·
10.0/changes/055允许在 recovery.conf 中按日志序列号(LSN)指定恢复停止点 · 新功能
允许在
recovery.conf中按日志序列号(LSN)指定恢复停止点(Michael Paquier)以前,只能按时间戳或 XID 选择停止点。
原始发布条目 ·
10.0/changes/056允许用户禁用 pg_stop_backup() 等待所有 WAL 完成归档的行为 · 新功能
允许用户禁用
pg_stop_backup()等待所有 WAL 完成归档的行为(David Steele)pg_stop_backup()的可选第二参数控制这一行为。原始发布条目 ·
10.0/changes/057通过更好地跟踪访问排他锁,提升热备重放性能 · 性能改进
通过更好地跟踪访问排他锁,提升热备重放性能(Simon Riggs,David Rowley)
原始发布条目 ·
10.0/changes/059提升两阶段提交恢复性能 · 性能改进
提升两阶段提交恢复性能(Stas Kelvich,Nikhil Sontakke,Michael Paquier)
原始发布条目 ·
10.0/changes/060修复正则表达式对较大字符码的字符类处理,尤其是 U+7FF 以上的 Unicode 字符 · BUG 修复
修复正则表达式对较大字符码的字符类处理,尤其是
U+7FF以上的 Unicode 字符(Tom Lane)以前,这类字符从不会被识别为属于
[[:alpha:]]等依赖区域设置的字符类。原始发布条目 ·
10.0/changes/062创建外键约束时,只检查被引用表上的 REFERENCES 权限 · 新功能
创建外键约束时,只检查被引用表上的
REFERENCES权限(Tom Lane)以前,还要求引用表上的
REFERENCES权限。这似乎源于对 SQL 标准的误读。由于创建外键约束(或任何其他类型的约束)需要拥有被约束的表,额外要求REFERENCES权限似乎毫无意义。原始发布条目 ·
10.0/changes/066增加 CREATE SEQUENCE AS 命令,用于创建与某个整数数据类型匹配的序列 · 新功能
增加
CREATE SEQUENCE AS命令,用于创建与某个整数数据类型匹配的序列(Peter Eisentraut)这简化了创建与基础列取值范围匹配的序列。
原始发布条目 ·
10.0/changes/068允许对具有 INSTEAD INSERT 触发器的视图执行 COPY view FROM source · 新功能
允许对具有
INSTEAD INSERT触发器的视图执行COPY(Haribabu Kommi)viewFROMsource这些触发器会接收
COPY读取的数据行。原始发布条目 ·
10.0/changes/069允许在 DDL 命令中指定不带参数的函数名,前提是该名称唯一 · 新功能
允许在 DDL 命令中指定不带参数的函数名,前提是该名称唯一(Peter Eisentraut)
例如,如果某个名称只对应一个函数,就允许对不带参数的该函数名执行
DROP FUNCTION。这是 SQL 标准要求的行为。原始发布条目 ·
10.0/changes/070允许用一条 DROP 命令删除多个函数、操作符和聚合 · 新功能
允许用一条
DROP命令删除多个函数、操作符和聚合(Peter Eisentraut)原始发布条目 ·
10.0/changes/071在 CREATE SERVER、CREATE USER MAPPING 和 CREATE COLLATION 中支持 IF NOT EXISTS · 新功能
在
CREATE SERVER、CREATE USER MAPPING和CREATE COLLATION中支持IF NOT EXISTS(Anastasia Lubennikova,Peter Eisentraut)原始发布条目 ·
10.0/changes/072使 VACUUM VERBOSE 报告跳过的冻结页数量和最老的 xmin · 新功能
使
VACUUM VERBOSE报告跳过的冻结页数量和最老的 xmin(Masahiko Sawada,Simon Riggs)这些信息也包含在log_autovacuum_min_duration的输出中。
原始发布条目 ·
10.0/changes/073加快 VACUUM 移除末尾空堆页的速度 · 新功能
加快
VACUUM移除末尾空堆页的速度(Claudio Freire,Álvaro Herrera)原始发布条目 ·
10.0/changes/074为 JSON 和 JSONB 增加全文检索支持 · 新功能
为
JSON和JSONB增加全文检索支持(Dmitry Dolgov)现在可以将函数
ts_headline()和to_tsvector()用于这些数据类型。原始发布条目 ·
10.0/changes/075允许重命名 ENUM 值 · 新功能
允许重命名
ENUM值(Dagfinn Ilmari Mannsåker)这使用语法
ALTER TYPE ... RENAME VALUE。原始发布条目 ·
10.0/changes/078增加简化的 regexp_match() 函数 · 新功能
增加简化的
regexp_match()函数(Emre Hasegeli)它类似于
regexp_matches(),但只返回第一次匹配的结果,因此不需要返回集合,在简单场景下更易使用。原始发布条目 ·
10.0/changes/082使 json_populate_record() 及相关函数递归处理 JSON 数组和对象 · 新功能
使
json_populate_record()及相关函数递归处理 JSON 数组和对象(Nikita Glukhov)此变更使目标 SQL 类型中的数组类型字段能够从 JSON 数组正确转换,复合类型字段能够从 JSON 对象正确转换。以前,这类情况会失败,因为 JSON 值的文本表示会被传给
array_in()或record_in(),而其语法不符合这些输入函数的预期。原始发布条目 ·
10.0/changes/084增加函数 txid_current_if_assigned(),用于返回当前事务 ID,或者在尚未分配事务 ID 时返回 NULL · 新功能
增加函数
txid_current_if_assigned(),用于返回当前事务 ID,或者在尚未分配事务 ID 时返回NULL(Craig Ringer)这与
txid_current()不同,后者始终返回事务 ID,并在必要时分配一个。与后者不同,此函数可以在备库上运行。原始发布条目 ·
10.0/changes/085增加函数 txid_status(),用于检查事务是否已提交 · 新功能
增加函数
txid_status(),用于检查事务是否已提交(Craig Ringer)这有助于在连接突然断开后,检查前一个事务是否其实已提交,只是您没有收到确认。
原始发布条目 ·
10.0/changes/086允许 make_date() 将负数年份解释为公元前(BC)年份 · 新功能
允许
make_date()将负数年份解释为公元前(BC)年份(Álvaro Herrera)原始发布条目 ·
10.0/changes/087使 to_timestamp() 和 to_date() 拒绝超出范围的输入字段 · 新功能
使
to_timestamp()和to_date()拒绝超出范围的输入字段(Artur Zakirov)例如,以前会接受
to_date('2009-06-40','YYYY-MM-DD')并返回2009-07-10。现在它会产生错误。原始发布条目 ·
10.0/changes/088允许将 PL/Python 的 cursor() 和 execute() 函数作为其计划对象参数的方法调用 · 新功能
允许将 PL/Python 的
cursor()和execute()函数作为其计划对象参数的方法调用(Peter Eisentraut)这允许采用更面向对象的编程风格。
原始发布条目 ·
10.0/changes/089允许 PL/pgSQL 的 GET DIAGNOSTICS 语句将值取回到数组元素中 · 新功能
允许 PL/pgSQL 的
GET DIAGNOSTICS语句将值取回到数组元素中(Tom Lane)以前,一项语法限制不允许目标变量是数组元素。
原始发布条目 ·
10.0/changes/090为 PL/Tcl 增加子事务命令 · 新功能
为 PL/Tcl 增加子事务命令(Victor Wagner)
这允许 PL/Tcl 查询失败而不中止整个函数。
原始发布条目 ·
10.0/changes/092增加服务器参数pltcl.start_proc和pltclu.start_proc,允许在 PL/Tcl 启动时调用初始化函数 · 新功能
增加服务器参数pltcl.start_proc和pltclu.start_proc,允许在 PL/Tcl 启动时调用初始化函数(Tom Lane)
原始发布条目 ·
10.0/changes/093增加函数 PQencryptPasswordConn(),允许在客户端创建更多类型的加密密码 · 新功能
增加函数
PQencryptPasswordConn(),允许在客户端创建更多类型的加密密码(Michael Paquier,Heikki Linnakangas)以前,只能使用
PQencryptPassword()创建MD5加密的密码。新函数还可以创建SCRAM-SHA-256加密的密码。原始发布条目 ·
10.0/changes/097将 ecpg 预处理器版本从 4.12 改为 10 · 新功能
将 ecpg 预处理器版本从 4.12 改为 10(Tom Lane)
今后,ecpg 版本将与 PostgreSQL 发行版的版本号一致。
原始发布条目 ·
10.0/changes/098为 psql 增加条件分支支持 · 新功能
为 psql 增加条件分支支持(Corey Huinker)
此功能增加了 psql 元命令
\if、\elif、\else和\endif。这主要有助于编写脚本。原始发布条目 ·
10.0/changes/099增加 psql 元命令 \gx,以扩展模式(\x)执行(\g)查询 · 新功能
增加 psql 元命令
\gx,以扩展模式(\x)执行(\g)查询(Christoph Berg)原始发布条目 ·
10.0/changes/100在反引号执行的字符串中展开 psql 变量引用 · 新功能
在反引号执行的字符串中展开 psql 变量引用(Tom Lane)
这在新的 psql 条件分支命令中尤其有用。
原始发布条目 ·
10.0/changes/101防止将 psql 的特殊变量设为无效值 · 新功能
防止将 psql 的特殊变量设为无效值(Daniel Vérité,Tom Lane)
以前,将 psql 的某个特殊变量设为无效值,会静默采用默认行为。现在,如果拟设置的新值无效,对特殊变量执行
\set就会失败。一个特殊例外是,对布尔值特殊变量执行\set,且新值为空或省略时,仍会将变量设为on;但现在它实际取得的就是该值,而不是空字符串。现在,对特殊变量执行\unset会显式将其设为默认值,这也是启动时取得的值。因此,控制变量现在始终有一个可显示的值,反映 psql 的实际行为。原始发布条目 ·
10.0/changes/102改进 psql 的 \d(显示关系)和 \dD(显示域)命令,在单独的列中显示排序规则、是否可空和默认值属性 · 新功能
改进 psql 的
\d(显示关系)和\dD(显示域)命令,在单独的列中显示排序规则、是否可空和默认值属性(Peter Eisentraut)以前,它们显示在同一个 “Modifiers” 列中。
原始发布条目 ·
10.0/changes/104使各个 \d 命令对没有匹配对象的情况的处理更一致 · 新功能
使各个
\d命令对没有匹配对象的情况的处理更一致(Daniel Gustafsson)现在,它们都将相关消息输出到 stderr,而非 stdout,消息的措辞也更一致。
原始发布条目 ·
10.0/changes/105改进 psql 的 Tab 补全 · 新功能
改进 psql 的 Tab 补全(Jeff Janes,Ian Barwick,Andreas Karlsson,Sehrope Sarkuni,Thomas Munro,Kevin Grittner,Dagfinn Ilmari Mannsåker)
原始发布条目 ·
10.0/changes/106增加 pgbench 选项 --log-prefix,用于控制日志文件前缀 · 新功能
增加 pgbench 选项
--log-prefix,用于控制日志文件前缀(Masahiko Sawada)原始发布条目 ·
10.0/changes/107允许 pgbench 的元命令跨越多行 · 新功能
允许 pgbench 的元命令跨越多行(Fabien Coelho)
现在可以通过在行尾写反斜杠并换行,将元命令延续到下一行。
原始发布条目 ·
10.0/changes/108增加pg_receivewal选项 -Z/--compress,用于指定压缩 · 新功能
增加pg_receivewal选项
-Z/--compress,用于指定压缩(Michael Paquier)原始发布条目 ·
10.0/changes/110增加pg_recvlogical选项 --endpos,用于指定结束位置 · 新功能
增加pg_recvlogical选项
--endpos,用于指定结束位置(Craig Ringer)这补充了现有的
--startpos选项。原始发布条目 ·
10.0/changes/111允许 pg_restore 排除模式 · 新功能
允许 pg_restore 排除模式(Michael Banck)
这增加了新的
-N/--exclude-schema选项。原始发布条目 ·
10.0/changes/113为 pg_dump 增加 --no-blobs 选项 · 新功能
为 pg_dump 增加
--no-blobs选项(Guillaume Lelarge)这会禁止转储大对象。
原始发布条目 ·
10.0/changes/114为 pg_dumpall 增加 --no-role-passwords 选项,以省略角色密码 · 新功能
为 pg_dumpall 增加
--no-role-passwords选项,以省略角色密码(Robins Tharakan,Simon Riggs)这使非超级用户也能够使用 pg_dumpall;如果没有此选项,它会因无法读取密码而失败。
原始发布条目 ·
10.0/changes/115对 pg_dump 和 pg_dumpall 生成的输出文件执行 fsync() · 新功能
对 pg_dump 和 pg_dumpall 生成的输出文件执行
fsync()(Michael Paquier)这能更可靠地确保输出在程序退出前已安全存储到磁盘上。可以通过新增的
--no-sync选项禁用此行为。原始发布条目 ·
10.0/changes/117允许 pg_basebackup 在 tar 模式下以流方式传输预写式日志 · 新功能
允许 pg_basebackup 在 tar 模式下以流方式传输预写式日志(Magnus Hagander)
WAL 将存储在与基础备份分开的 tar 文件中。
原始发布条目 ·
10.0/changes/118使 pg_basebackup 使用临时复制槽 · 新功能
使 pg_basebackup 使用临时复制槽(Magnus Hagander)
当 pg_basebackup 使用默认选项进行 WAL 流传输时,默认会使用临时复制槽。
原始发布条目 ·
10.0/changes/119更谨慎地确保 pg_basebackup 和 pg_receivewal 在所有需要的位置执行 fsync · 新功能
更谨慎地确保 pg_basebackup 和 pg_receivewal 在所有需要的位置执行 fsync(Michael Paquier)
原始发布条目 ·
10.0/changes/120增加 pg_basebackup 选项 --no-sync,用于禁用 fsync · 新功能
增加 pg_basebackup 选项
--no-sync,用于禁用 fsync(Michael Paquier)原始发布条目 ·
10.0/changes/121改进 pg_basebackup 对需要跳过的目录的处理 · 新功能
改进 pg_basebackup 对需要跳过的目录的处理(David Steele)
原始发布条目 ·
10.0/changes/122为 pg_ctl 的等待和不等待操作增加长选项,分别为 --wait 和 --no-wait · 新功能
为 pg_ctl 的等待和不等待操作增加长选项,分别为
--wait和--no-wait(Vik Fearing)原始发布条目 ·
10.0/changes/124为 pg_ctl 的服务器选项增加长选项 --options · 新功能
为 pg_ctl 的服务器选项增加长选项
--options(Peter Eisentraut)原始发布条目 ·
10.0/changes/125使 pg_ctl start --wait 通过观察 postmaster.pid 来检测服务器是否就绪,而不是尝试连接 · 新功能
使
pg_ctl start --wait通过观察postmaster.pid来检测服务器是否就绪,而不是尝试连接(Tom Lane)postmaster 现在会在
postmaster.pid中报告其已准备好接受连接的状态,pg_ctl 会检查该文件,以检测启动是否完成。这比旧方法更高效可靠,也消除了启动期间连接尝试被拒绝所产生的 postmaster 日志条目。原始发布条目 ·
10.0/changes/126缩短 pg_ctl 等待 postmaster 启动或停止时的响应时间 · 新功能
缩短 pg_ctl 等待 postmaster 启动或停止时的响应时间(Tom Lane)
现在,pg_ctl 在等待 postmaster 状态变化时每秒探测十次,而不是每秒一次。
原始发布条目 ·
10.0/changes/127确保 pg_ctl 在所等待的操作未于超时期限内完成时,以非零状态退出 · 新功能
确保 pg_ctl 在所等待的操作未于超时期限内完成时,以非零状态退出(Peter Eisentraut)
在这种情况下,
start和promote操作现在返回退出状态 1,而非 0。stop操作一直如此。原始发布条目 ·
10.0/changes/128改用由两部分组成的发行版版本号 · 新功能
改用由两部分组成的发行版版本号(Peter Eisentraut,Tom Lane)
发行版版本号现在由两部分组成(如
10.1),而非三部分(如9.6.3)。大版本现在只增加第一个数字,小版本只增加第二个数字。发布分支将用单个数字表示(如10,而非9.6)。此变更旨在减少用户对 PostgreSQL 大版本和小版本含义的困惑。原始发布条目 ·
10.0/changes/129改进 pgindent 的行为 · 新功能
改进 pgindent 的行为(Piotr Stefaniak,Tom Lane)
我们已切换到新的 pg_bsd_indent 版本,其中纳入了 FreeBSD 项目近期的改进。这修复了许多导致 C 代码格式异常的小缺陷。最明显的是,括号内的行(例如多行函数调用)现在统一缩进到与左括号对齐,即使这样会使代码超出右边界。
原始发布条目 ·
10.0/changes/130在 Windows 上,自动将所有 PG_FUNCTION_INFO_V1 函数标记为 DLLEXPORT · 新功能
在 Windows 上,自动将所有
PG_FUNCTION_INFO_V1函数标记为DLLEXPORT(Laurenz Albe)如果第三方代码使用
extern函数声明,也应在这些声明中添加DLLEXPORT标记。原始发布条目 ·
10.0/changes/132移除不再需要的 SPI 函数 SPI_push()、SPI_pop()、SPI_push_conditional()、SPI_pop_conditional() 和 SPI_restore_connection() · 新功能
移除不再需要的 SPI 函数
SPI_push()、SPI_pop()、SPI_push_conditional()、SPI_pop_conditional()和SPI_restore_connection()(Tom Lane)它们的功能现在会自动执行。目前提供了这些名称的空操作宏,使外部模块不必立即更新,但最终应移除这些调用。
此变更的一个附带影响是,
SPI_palloc()及相关函数现在要求存在活动的 SPI 连接;没有连接时,它们不会退化为简单的palloc()调用。以前的行为用途不大,还存在意外内存泄漏的风险。原始发布条目 ·
10.0/changes/133增加类似 slab 的内存分配器,以高效分配固定大小的内存 · BUG 修复
增加类似 slab 的内存分配器,以高效分配固定大小的内存(Tomas Vondra)
原始发布条目 ·
10.0/changes/135在 Linux 和 FreeBSD 上使用 POSIX 信号量代替 SysV 信号量 · 新功能
在 Linux 和 FreeBSD 上使用 POSIX 信号量代替 SysV 信号量(Tom Lane)
这避免了平台特定的 SysV 信号量使用限制。
原始发布条目 ·
10.0/changes/136如果 clock_gettime() 可用,则改用它进行持续时间测量 · 新功能
如果
clock_gettime()可用,则改用它进行持续时间测量(Tom Lane)如果
clock_gettime()不可用,仍使用gettimeofday()。原始发布条目 ·
10.0/changes/139允许 WaitLatchOrSocket() 在 Windows 上等待套接字连接 · 新功能
允许
WaitLatchOrSocket()在 Windows 上等待套接字连接(Andres Freund)原始发布条目 ·
10.0/changes/141tupconvert.c 中的函数不再仅为嵌入不同的复合类型 OID 而转换元组 · 新功能
tupconvert.c中的函数不再仅为嵌入不同的复合类型 OID 而转换元组(Ashutosh Bapat,Tom Lane)大多数调用者并不关心复合类型 OID;但如果结果元组要作为复合 Datum 使用,就应采取措施确保其中插入了正确的 OID。
原始发布条目 ·
10.0/changes/142使用 XSLT 构建 PostgreSQL 文档 · 新功能
使用 XSLT 构建 PostgreSQL 文档(Peter Eisentraut)
以前使用的是 Jade、DSSSL 和 JadeTex。
原始发布条目 ·
10.0/changes/145在postgres_fdw中,尽可能将聚合函数下推到远程服务器 · 新功能
在postgres_fdw中,尽可能将聚合函数下推到远程服务器(Jeevan Chalke,Ashutosh Bapat)
这减少了必须从远程服务器传输的数据量,并将聚合计算从发出请求的服务器转移出去。
原始发布条目 ·
10.0/changes/148在 postgres_fdw 中,在更多情况下将连接下推到远程服务器 · 新功能
在 postgres_fdw 中,在更多情况下将连接下推到远程服务器(David Rowley,Ashutosh Bapat,Etsuro Fujita)
原始发布条目 ·
10.0/changes/149正确支持 postgres_fdw 表中的 OID 列 · 新功能
正确支持 postgres_fdw 表中的
OID列(Etsuro Fujita)以前,
OID列始终返回零。原始发布条目 ·
10.0/changes/150允许btree_gist和btree_gin为枚举类型建立索引 · 新功能
允许btree_gist和btree_gin为枚举类型建立索引(Andrew Dunstan)
这允许在排他约束中使用枚举。
原始发布条目 ·
10.0/changes/151为 btree_gist 增加对 UUID 数据类型的索引支持 · 新功能
为 btree_gist 增加对
UUID数据类型的索引支持(Paul Jungwirth)原始发布条目 ·
10.0/changes/152在pg_stat_statements中,将被忽略的常量显示为 $N,而非 ? · 新功能
在pg_stat_statements中,将被忽略的常量显示为
$N,而非?(Lukas Fittl)原始发布条目 ·
10.0/changes/154允许pg_buffercache使用更少的锁运行 · 新功能
允许pg_buffercache使用更少的锁运行(Ivan Kartyshov)
这降低了它在生产系统上运行时的干扰。
原始发布条目 ·
10.0/changes/156增加pgstattuple函数 pgstathashindex(),用于查看 hash 索引统计信息 · 新功能
增加pgstattuple函数
pgstathashindex(),用于查看 hash 索引统计信息(Ashutosh Sharma)原始发布条目 ·
10.0/changes/157使用 GRANT 权限控制 pgstattuple 函数的使用 · 新功能
使用
GRANT权限控制 pgstattuple 函数的使用(Stephen Frost)这使 DBA 可以允许非超级用户运行这些函数。
原始发布条目 ·
10.0/changes/158减少 pgstattuple 检查 hash 索引时的锁定 · 新功能
减少 pgstattuple 检查 hash 索引时的锁定(Amit Kapila)
原始发布条目 ·
10.0/changes/159增加pageinspect函数 page_checksum(),用于显示页的校验和 · 新功能
增加pageinspect函数
page_checksum(),用于显示页的校验和(Tomas Vondra)原始发布条目 ·
10.0/changes/160增加 pageinspect 函数 bt_page_items(),用于从页映像中打印页项 · 新功能
增加 pageinspect 函数
bt_page_items(),用于从页映像中打印页项(Tomas Vondra)原始发布条目 ·
10.0/changes/161为 pageinspect 增加 hash 索引支持 · 新功能
为 pageinspect 增加 hash 索引支持(Jesper Pedersen,Ashutosh Sharma)
原始发布条目 ·
10.0/changes/162
安全证据
共 35 条记录,来自官方安全矩阵及发布说明的提及。只有安全快照明确列出此分支时才显示修复版本;仅有提及不能确定漏洞适用性或新修复。
CVE-2022-2625 · Extension scripts replace objects not belonging to the extension · CVSS 7.1
Some extensions use CREATE OR REPLACE or CREATE IF NOT EXISTS commands. Some don't adhere to the documented rule to target only objects known to be extension members already. An attack requires permission to create non-temporary objects in at least one schema, ability to lure or wait for an administrator to create or update an affected extension in that schema, and ability to lure or wait for a victim to use the object targeted in CREATE OR REPLACE or CREATE IF NOT EXISTS . Given all three prerequisites, the attacker can run arbitrary code as the victim role, which may be a superuser. Known-affected extensions include both PostgreSQL-bundled and non-bundled extensions. PostgreSQL is blocking this attack in the core server, so there's no need to modify individual extensions. The PostgreSQL project thanks Sven Klemm for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.22。组件:core server。
官方受影响分支记录:10。
AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
发布说明中的提及:
CVE-2022-1552 · Autovacuum, REINDEX, and others omit "security restricted operation" sandbox · CVSS 8.8
Autovacuum, REINDEX , CREATE INDEX , REFRESH MATERIALIZED VIEW , CLUSTER , and pg_amcheck made incomplete efforts to operate safely when a privileged user is maintaining another user's objects. Those commands activated relevant protections too late or not at all. An attacker having permission to create non-temp objects in at least one schema could execute arbitrary SQL functions under a superuser identity. While promptly updating PostgreSQL is the best remediation for most users, a user unable to do that can work around the vulnerability by disabling autovacuum, not manually running the above commands, and not restoring from output of the pg_dump command. Performance may degrade quickly under this workaround. VACUUM is safe, and all commands are fine when a trusted user owns the target object. The PostgreSQL project thanks Alexander Lakhin for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.21。组件:core server。
官方受影响分支记录:10。
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
发布说明中的提及:
CVE-2021-3449 · CVE-2021-3449
CVE-2021-32028 · Memory disclosure in INSERT ... ON CONFLICT ... DO UPDATE · CVSS 6.5
Using an INSERT ... ON CONFLICT ... DO UPDATE command on a purpose-crafted table, an attacker can read arbitrary bytes of server memory. In the default configuration, any authenticated database user can create prerequisite objects and complete this attack at will. A user lacking the CREATE and TEMPORARY privileges on all databases and the CREATE privilege on all schemas cannot use this attack at will. The PostgreSQL project thanks Andres Freund for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.17。组件:core server。
官方受影响分支记录:10。
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
发布说明中的提及:
CVE-2021-32027 · Buffer overrun from integer overflow in array subscripting calculations · CVSS 6.5
While modifying certain SQL array values, missing bounds checks let authenticated database users write arbitrary bytes to a wide area of server memory. The PostgreSQL project thanks Tom Lane for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.17。组件:core server。
官方受影响分支记录:10。
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
发布说明中的提及:
CVE-2021-23222 · libpq processes unencrypted bytes from man-in-the-middle · CVSS 3.7
A man-in-the-middle attacker can inject false responses to the client's first few queries, despite the use of SSL certificate verification and encryption. If more preconditions hold, the attacker can exfiltrate the client's password or other confidential data that might be transmitted early in a session. The attacker must have a way to trick the client's intended server into making the confidential data accessible to the attacker. A known implementation having that property is a PostgreSQL configuration vulnerable to CVE-2021-23214 . As with any exploitation of CVE-2021-23214 , the server must be using trust authentication with a clientcert requirement or using cert authentication. To disclose a password, the client must be in possession of a password, which is atypical when using an authentication configuration vulnerable to CVE-2021-23214 . The attacker must have some other way to access the server to retrieve the exfiltrated data (a valid, unprivileged login account would be sufficient). The PostgreSQL project thanks Jacob Champion for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.19。组件:client。
官方受影响分支记录:10。
AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
发布说明中的提及:
CVE-2021-23214 · Server processes unencrypted bytes from man-in-the-middle · CVSS 8.1
When the server is configured to use trust authentication with a clientcert requirement or to use cert authentication, a man-in-the-middle attacker can inject arbitrary SQL queries when a connection is first established, despite the use of SSL certificate verification and encryption. This is similar to CVE-2011-0411 (different product). The PostgreSQL project thanks Jacob Champion for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.19。组件:core server。
官方受影响分支记录:10。
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
发布说明中的提及:
CVE-2020-25696 · psql's \gset allows overwriting specially treated variables · CVSS 7.5
The \gset meta-command, which sets psql variables based on query results, does not distinguish variables that control psql behavior. If an interactive psql session uses \gset when querying a compromised server, the attacker can execute arbitrary code as the operating system account running psql . Using \gset with a prefix not found among specially treated variables, e.g. any lowercase string, precludes the attack in an unpatched psql . The PostgreSQL project thanks Nick Cleaton for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.15。组件:client。
官方受影响分支记录:10。
AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
发布说明中的提及:
CVE-2020-25695 · Multiple features escape "security restricted operation" sandbox · CVSS 8.8
An attacker having permission to create non-temporary objects in at least one schema can execute arbitrary SQL functions under the identity of a superuser. While promptly updating PostgreSQL is the best remediation for most users, a user unable to do that can work around the vulnerability by disabling autovacuum and not manually running ANALYZE , CLUSTER , REINDEX , CREATE INDEX , VACUUM FULL , REFRESH MATERIALIZED VIEW , or a restore from output of the pg_dump command. Performance may degrade quickly under this workaround. VACUUM without the FULL option is safe, and all commands are fine when a trusted user owns the target object. The PostgreSQL project thanks Etienne Stalmans for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.15。组件:core server。
官方受影响分支记录:10。
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
发布说明中的提及:
CVE-2020-25694 · Reconnection can downgrade connection security settings · CVSS 8.1
Many PostgreSQL-provided client applications have options that create additional database connections. Some of those applications reuse only the basic connection parameters (e.g. host , user , port ), dropping others. If this drops a security-relevant parameter (e.g. channel_binding , sslmode , requirepeer , gssencmode ), the attacker has an opportunity to complete a MITM attack or observe cleartext transmission. Affected applications are clusterdb , pg_dump , pg_restore , psql , reindexdb , and vacuumdb . The vulnerability arises only if one invokes an affected client application with a connection string containing a security-relevant parameter. This also fixes how the \connect command of psql reuses connection parameters, i.e. all non-overridden parameters from a previous connection string now re-used. The PostgreSQL project thanks Peter Eisentraut for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.15。组件:client。
官方受影响分支记录:10。
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
发布说明中的提及:
CVE-2020-1720 · ALTER ... DEPENDS ON EXTENSION is missing authorization checks. · CVSS 3.1
The ALTER ... DEPENDS ON EXTENSION sub-commands do not perform authorization checks, which can allow an unprivileged user to drop any function, procedure, materialized view, index, or trigger under certain conditions. This attack is possible if an administrator has installed an extension and an unprivileged user can CREATE , or an extension owner either executes DROP EXTENSION predictably or can be convinced to execute DROP EXTENSION . The PostgreSQL project thanks Tom Lane for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.12。组件:core server。
官方受影响分支记录:10。
AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
发布说明中的提及:
CVE-2020-14350 · Uncontrolled search path element in CREATE EXTENSION · CVSS 7.1
When a superuser runs certain CREATE EXTENSION statements, users may be able to execute arbitrary SQL functions under the identity of that superuser. The attacker must have permission to create objects in the new extension's schema or a schema of a prerequisite extension. Not all extensions are vulnerable. In addition to correcting the extensions provided with PostgreSQL, the PostgreSQL Global Development Group is issuing guidance for third-party extension authors to secure their own work. The PostgreSQL project thanks Andres Freund for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.14。组件:core server。
官方受影响分支记录:10。
AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
发布说明中的提及:
CVE-2020-14349 · Uncontrolled search path element in logical replication · CVSS 7.5
The PostgreSQL search_path setting determines schemas searched for tables, functions, operators, etc. The CVE-2018-1058 fix caused most PostgreSQL-provided client applications to sanitize search_path , but logical replication continued to leave search_path unchanged. Users of a replication publisher or subscriber database can create objects in the public schema and harness them to execute arbitrary SQL functions under the identity running replication, often a superuser. Installations having adopted a documented secure schema usage pattern are not vulnerable. The PostgreSQL project thanks Noah Misch for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.14。组件:core server。
官方受影响分支记录:10。
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
发布说明中的提及:
CVE-2020-10733 · Windows installer runs executables from uncontrolled directories · CVSS 6.7
The Windows installer for PostgreSQL invokes system-provided executables that do not have fully-qualified paths. Executables in the directory where the installer loads or the current working directory take precedence over the intended executables. An attacker having permission to add files into one of those directories can use this to execute arbitrary code with the installer's administrative rights. The PostgreSQL project thanks Hou JingYi (@hjy79425575) for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.13。组件:packaging。
官方受影响分支记录:10。
AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
CVE-2019-3466 · pg_ctlcluster script in postgresql-common does not drop privileges when creating socket/statistics temporary directories · CVSS 8.4
A PostgreSQL superuser could escalate to root using a deficiency in the pg_ctlcluster command. pg_ctlcluster is a utility provided by the "postgresql-common" package that is installed with PostgreSQL on Debian and Ubuntu platforms.
以上保留官方英文漏洞说明。
本分支修复于:10.11。组件:packaging。
官方受影响分支记录:10。
AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H
CVE-2019-10211 · Windows installer bundled OpenSSL executes code from unprotected directory · CVSS 7.8
When the database server or libpq client library initializes SSL, libeay32.dll attempts to read configuration from a hard-coded directory. Typically, the directory does not exist, but any local user could create it and inject configuration. This configuration can direct OpenSSL to load and execute arbitrary code as the user running a PostgreSQL server or client. Most PostgreSQL client tools and libraries use libpq , and one can encounter this vulnerability by using any of them. This vulnerability is much like CVE-2019-5443 , but it originated independently. One can work around the vulnerability by setting environment variable OPENSSL_CONF to "NUL:/openssl.cnf" or any other name that cannot exist as a file. The PostgreSQL project thanks Daniel Gustafsson of the curl security team for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.10。组件:packaging。
官方受影响分支记录:10。
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVE-2019-10210 · Windows installer writes superuser password to unprotected temporary file · CVSS 6.7
The EnterpriseDB Windows installer writes a password to a temporary file in its installation directory, creates initial databases, and deletes the file. During those seconds while the file exists, a local attacker can read the PostgreSQL superuser password from the file. The PostgreSQL project thanks Noah Misch for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.10。组件:packaging。
官方受影响分支记录:10。
AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
CVE-2019-10208 · TYPE in pg_temp executes arbitrary SQL during SECURITY DEFINER execution · CVSS 7.5
Given a suitable SECURITY DEFINER function, an attacker can execute arbitrary SQL under the identity of the function owner. An attack requires EXECUTE permission on the function, which must itself contain a function call having inexact argument type match. For example, length('foo'::varchar) and length('foo') are inexact, while length('foo'::text) is exact. As part of exploiting this vulnerability, the attacker uses CREATE DOMAIN to create a type in a pg_temp schema. The attack pattern and fix are similar to that for CVE-2007-2138 . Writing SECURITY DEFINER functions continues to require following the considerations noted in the documentation: https://www.postgresql.org/docs/current/sql-createfunction.html#SQL-CREATEFUNCTION-SECURITY The PostgreSQL project thanks Tom Lane for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.10。组件:core server。
官方受影响分支记录:10。
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
发布说明中的提及:
CVE-2019-10164 · Stack-based buffer overflow via setting a password · CVSS 7.5
An authenticated user could create a stack-based buffer overflow by changing their own password to a purpose-crafted value. In addition to the ability to crash the PostgreSQL server, this could be further exploited to execute arbitrary code as the PostgreSQL operating system account. Additionally, a rogue server could send a specifically crafted message during the SCRAM authentication process and cause a libpq-enabled client to either crash or execute arbitrary code as the client's operating system account. This issue is fixed by upgrading and restarting your PostgreSQL server as well as your libpq installations. The PostgreSQL Project thanks Alexander Lakhin for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.9。组件:core server。
官方受影响分支记录:10。
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
发布说明中的提及:
CVE-2019-10130 · Selectivity estimators bypass row security policies · CVSS 3.1
PostgreSQL maintains statistics for tables by sampling data available in columns; this data is consulted during the query planning process. Prior to this release, a user able to execute SQL queries with permissions to read a given column could craft a leaky operator that could read whatever data had been sampled from that column. If this happened to include values from rows that the user is forbidden to see by a row security policy, the user could effectively bypass the policy. This is fixed by only allowing a non-leakproof operator to use this data if there are no relevant row security policies for the table. The PostgreSQL project thanks Dean Rasheed for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.8。组件:core server。
官方受影响分支记录:10。
AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N
发布说明中的提及:
CVE-2019-10128 · EnterpriseDB Windows installer does not clear permissive ACL entries · CVSS 7.0
Due to both the EnterpriseDB and BigSQL Windows installers not locking down the permissions of the PostgreSQL binary installation directory and the data directory, an unprivileged Windows user account and an unprivileged PostgreSQL account could cause the PostgreSQL service account to execute arbitrary code. This vulnerability is present in all supported versions of PostgreSQL for these installers, and possibly exists in older versions. Both sets of installers have fixed the permissions for these directories for both new and existing installations. If you have installed PostgreSQL on Windows using other methods, we advise that you check that your PostgreSQL binary directories are writable only to trusted users and that your data directories are only accessible to trusted users. The PostgreSQL project thanks Conner Jones for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.8。组件:packaging。
官方受影响分支记录:10。
AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
CVE-2019-10127 · BigSQL Windows installer does not clear permissive ACL entries. · CVSS 7.0
Due to both the EnterpriseDB and BigSQL Windows installers not locking down the permissions of the PostgreSQL binary installation directory and the data directory, an unprivileged Windows user account and an unprivileged PostgreSQL account could cause the PostgreSQL service account to execute arbitrary code. This vulnerability is present in all supported versions of PostgreSQL for these installers, and possibly exists in older versions. Both sets of installers have fixed the permissions for these directories for both new and existing installations. If you have installed PostgreSQL on Windows using other methods, we advise that you check that your PostgreSQL binary directories are writable only to trusted users and that your data directories are only accessible to trusted users. The PostgreSQL project thanks Conner Jones for reporting this problem.
以上保留官方英文漏洞说明。
本分支修复于:10.8。组件:packaging。
官方受影响分支记录:10。
AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H