## E.1. Release 14.2 [E.1.1. Migration to Version 14.2](release-14-2.html#id-1.11.6.5.4)[E.1.2. Changes](release-14-2.html#id-1.11.6.5.5) **Release date:**2022-02-10 This release contains a variety of fixes from 14.1. For information about new features in major release 14, see[Section E.3](release-14.html). ### E.1.1. Migration to Version 14.2 A dump/restore is not required for those running 14.X. However, some bugs have been found that may have resulted in corrupted indexes, as explained in the first two changelog entries. If any of those cases apply to you, it's recommended to reindex possibly-affected indexes after updating. Also, if you are upgrading from a version earlier than 14.1, see[Section E.2](release-14-1.html). ### E.1.2. Changes - Enforce standard locking protocol for TOAST table updates, to prevent problems with`REINDEX CONCURRENTLY`(Michael Paquier) If applied to a TOAST table or TOAST table's index,`REINDEX CONCURRENTLY`tended to produce a corrupted index. This happened because sessions updating TOAST entries released their`ROW EXCLUSIVE`locks immediately, rather than holding them until transaction commit as all other updates do. The fix is to make TOAST updates hold the table lock according to the normal rule. Any existing corrupted indexes can be repaired by reindexing again. - Fix corruption of HOT chains when a RECENTLY_DEAD tuple changes state to fully DEAD during page pruning (Andres Freund) It was possible for`VACUUM`to remove a recently-dead tuple while leaving behind a redirect item that pointed to it. When the tuple's item slot is later re-used by some new tuple, that tuple would be seen as part of the pre-existing HOT chain, creating a form of index corruption. If this has happened, reindexing the table should repair the damage. However, this is an extremely low-probability scenario, so we do not recommend reindexing just on the chance that it might have happened. - Fix crash in EvalPlanQual rechecks for tables with a mix of local and foreign partitions (Etsuro Fujita) - Fix dangling pointer in`COPY TO`(Bharath Rupireddy) This oversight could cause an incorrect error message or a crash after an error in`COPY`. - Avoid null-pointer crash in`ALTER STATISTICS`when the statistics object is dropped concurrently (Tomas Vondra) - Correctly handle alignment padding when extracting a range from a multirange (Alexander Korotkov) This error could cause crashes when handling multiranges over variable-length data types. - Fix over-optimistic use of hashing for anonymous`RECORD`data types (Tom Lane) This prevents some cases of “could not identify a hash function for type record” errors. - Fix incorrect plan creation for parallel single-child Append nodes (David Rowley) In some cases the Append would be simplified away when it should not be, leading to wrong query results (duplicated rows). - Fix index-only scan plans for cases where not all index columns can be returned (Tom Lane) If an index has both returnable and non-returnable columns, and one of the non-returnable columns is an expression using a table column that appears in a returnable index column, then a query using that expression could result in an index-only scan plan that attempts to read the non-returnable column, instead of recomputing the expression from the returnable column as intended. The non-returnable column would read as NULL, resulting in wrong query results. - Fix Memoize plan nodes to handle subplans that use parameters coming from above the Memoize (David Rowley) - Fix Memoize plan nodes to work correctly with non-hashable join operators (David Rowley) - Ensure that casting to an unspecified typmod generates a RelabelType node rather than a length-coercion function call (Tom Lane) While the coercion function should do the right thing (nothing), this translation is undesirably inefficient. - Fix checking of`anycompatible`-family data type matches (Tom Lane) In some cases the parser would think that a function or operator with`anycompatible`-family polymorphic parameters matches a set of arguments that it really shouldn't match. In reported cases, that led to matching more than one operator to a call, leading to ambiguous-operator errors; but a failure later on is also possible. - Fix WAL replay failure when database consistency is reached exactly at a WAL page boundary (Álvaro Herrera) - Fix startup of a physical replica to tolerate transaction ID wraparound (Abhijit Menon-Sen, Tomas Vondra) If a replica server is started while the set of active transactions on the primary crosses a wraparound boundary (so that there are some newer transactions with smaller XIDs than older ones), the replica would fail with “out-of-order XID insertion in KnownAssignedXids”. The replica would retry, but could never get past that error. - In logical replication, avoid double transmission of a child table's data (Hou Zhijie) If a publication includes both child and parent tables, and has the`publish_via_partition_root`option set, subscribers uselessly initiated synchronization on both child and parent tables. Ensure that only the parent table is synchronized in such cases. - Remove lexical limitations for SQL commands issued on a logical replication connection (Tom Lane) The walsender process would fail for a SQL command containing an unquoted semicolon, or with dollar-quoted literals containing odd numbers of single or double quote marks, or when the SQL command starts with a comment. Moreover, faulty error recovery could lead to unexpected errors in later commands too. - Ensure that replication origin timestamp is set while replicating a`ROLLBACK PREPARED`operation (Masahiko Sawada) - Fix possible loss of the commit timestamp for the last subtransaction of a transaction (Alex Kingsborough, Kyotaro Horiguchi) - Be sure to`fsync`the`pg_logical/mappings`subdirectory during checkpoints (Nathan Bossart) On some filesystems this oversight could lead to losing logical rewrite status files after a system crash. - Build extended statistics for partitioned tables (Justin Pryzby) A previous bug fix disabled building of extended statistics for old-style inheritance trees, but it also prevented building them for partitioned tables, which was an unnecessary restriction. This change allows`ANALYZE`to compute values for statistics objects for partitioned tables. (But note that autovacuum does not process partitioned tables as such, so you must periodically issue manual`ANALYZE`on the partitioned table if you want to maintain such statistics.) - 忽略继承树的扩展统计信息 (Justin Pryzby) 目前,扩展统计值仅针对每个表在本地计算,而不是针对整个继承树。但是,在规划跨继承树的查询时错误地参考了这些值,可能导致比默认值更差的估计。 - 当分区表的行类型在别处用作复合类型时,不允许更改分区表列的数据类型 (Tom Lane) 对于常规表,这种限制早已存在,但是由于疏忽,它没有检查分区表。 - 不允许`ALTER TABLE ... DROP NOT NULL`对于作为副本标识索引一部分的列(唐海英,侯志杰) 主键索引已经存在同样的禁令。 - 期间正确更新缓存表状态`使用索引更改表添加主键`(侯志杰) 并发会话未能更新他们对表是否具有主键的意见,可能导致不正确的逻辑复制行为。 - 切换时正确更新缓存表状态`副本身份`指数(唐海英、侯志杰) 并发会话未能更新他们对哪个索引是副本身份的看法,这可能导致不正确的逻辑复制行为。 - 当索引列的数据类型与运算符类的声明输入类型二进制兼容时,修复 SP-GiST 索引的失败 (Tom Lane) 这种情况应该可以工作,但由于“当叶类型与输入类型不同时必须定义压缩方法”而失败。 - 允许在计算最旧的 xmin 时忽略并行清理和并发索引构建 (Masahiko Sawada) 这些操作的非并行实例已被忽略,但逻辑不适用于并行情况。阻止 xmin 范围会产生不良影响,例如延迟真空清理。 - 修复更新表达式索引时的内存泄漏 (Peter Geoghegan) 一个`更新`影响许多行可能会消耗大量内存。 - 避免内存泄漏`重新分配拥有者`重新分配许多对象所有权的操作 (Justin Pryzby) - 通过避免不必要的缓存访问来提高 walsender 发送逻辑更改的性能(侯志杰) - 修复显示`证书`身份验证方法的选项`pg_hba_file_rules`视图(马格努斯·哈根德) 这`证书`身份验证方法意味着`clientcert=验证完整`,但是`pg_hba_file_rules`查看错误报告`clientcert=验证-ca`. - 确保会话的目标是`pg_log_backend_memory_contexts()`仅将其结果发送到服务器的日志(Fujii Masao) 以前,足够高的设置`client_min_messages`可能导致日志消息也被发送到连接的客户端。由于该客户没有要求它,这将是令人惊讶的(并且可能违反有线协议)。 - 修复出现在中的整行变量的显示`插入...值`规则(汤姆·莱恩) 整行变量将打印为“var.\*”,但这允许在重新加载规则时将其扩展到单独的列,从而产生不同的语义。像我们在其他地方所做的那样,附加一个显式的演员表来防止这种情况发生。 - 反向列出 SQL 标准函数体时,适当地显示函数参数`插入...选择`(汤姆·莱恩) 以前,他们会作为`$*`ñ`*`即使参数有名称。 - 将 Unicode 字符串规范化应用于空字符串时修复一字节缓冲区溢出 (Michael Paquier) 由于对齐方面的考虑,这种做法的实际影响是有限的;但在调试版本中,引发了警告。 - 修复或删除一些不正确的断言(Simon Riggs、Michael Paquier、Alexander Lakhin) 这些错误应该只影响调试版本,而不是生产。 - 修复可能导致无法本地化在多线程使用 libpq 或 ecpglib 早期报告的错误消息的竞争条件 (Tom Lane) - 避免打电话`错误`来自 libpq 的`取消`功能(汤姆·莱恩) `取消`从信号处理程序调用应该是安全的,但是`错误`不安全。错误使用仅发生在向服务器发送取消消息失败的不太可能的情况下,这可能是缺少报告的原因。 - 制作 psql 的`\密码`命令默认设置密码`当前用户`,而不是连接的原始用户名 (Tom Lane) 这与记录的行为一致,并避免可能的权限失败,如果`设定角色`或者`设置会话授权`自会议开始以来已经完成。为防止混淆,要操作的角色名称现在包含在密码提示中。 - 修复 psql`\d`用于识别父触发器的命令查询 (Justin Pryzby) 如果一个分区有触发器并且在某个父分区表上存在同名的不相关语句级触发器,则之前的编码失败,“子查询返回了多个用作表达式的行”。 - 制作 psql 的`\d`命令按名称而不是 OID 对表的扩展统计对象进行排序 (Justin Pryzby) - 修复 psql 的枚举类型标签值的制表符补全 (Tom Lane) - 修复使用终端作为数据源或目标时 Windows 上的故障(Dmitry Koval、Juan José Santamaría Flecha、Michael Paquier) 这会影响 psql 的`\复制`命令,以及 pg\_符合逻辑的`-f -`. - 在 psql 和其他一些客户端程序中,避免尝试调用`获取文本()`来自 control-C 信号处理程序 (Tom Lane) 虽然没有报告的故障与此错误有关,但这似乎不太可能是安全的事情。 - 允许在pg中取消初始密码提示\_接收和 pg_recvlogical(汤姆·莱恩,内森·博萨特) 以前,在提示输入密码时,无法通过 control-C 终止这些程序。 - 修复 pg_dump 用户定义转换的转储排序 (Tom Lane) 在极少数情况下,输出脚本可能会在创建之前引用用户定义的转换。 - 修复 pg\_垃圾场`--插入`和`--列插入`处理包含生成列和删除列的表的模式 (Tom Lane) - 修复 pg 中可能的错误报告\_转储和 pg\_基本备份 (Tom Lane) 之前的代码无法检查来自某些内核调用的错误,并且在其他情况下可能会报告错误的 errno 值。 - 修复仅索引扫描的结果`贡献/btree_gist`索引`字符(*`ñ`*)`列(汤姆·莱恩) 仅索引扫描返回的列值删除了尾随空格,这不是预期的行为。发生这种情况是因为这就是数据在索引中存储的方式。此修复更改了要存储的代码`字符(*`ñ`*)`具有预期空间填充量的值。这种索引的行为不会立即改变,除非您`重新索引`它;否则,在更新过程中,空格分隔的值将随着时间的推移逐渐被替换。不使用仅索引扫描计划的查询在任何情况下都不会受到影响。 - 修复边缘情况`postgres_fdw`异步查询的处理(藤田悦郎) 在尝试并行扫描外部表时,这些错误可能会导致崩溃或不正确的结果。 - 更改配置以使用 Python 的 sysconfig 模块,而不是已弃用的 distutils 模块,以确定如何构建 PL/Python (Peter Eisentraut, Tom Lane, Andres Freund) 在 Python 3.10 中,这避免了有关 distutils 在 Python 3.12 中被弃用和计划删除的配置时警告。据推测,一旦 3.12 出来,`配置 --with-python`会完全失败。这种面向未来的做法是有代价的:在 Python 2.7 之前和 Python 3 分支中的 3.2 之前不存在 sysconfig,因此不再可能针对早已死去的 Python 版本构建 PL/Python。 - 重新允许不使用 OpenSSL 的交叉编译 (Tom Lane) 配置应该假设`/dev/urandom`将在目标系统上可用,但它失败了。 - 使用 Perl 5.28 及更高版本修复 Windows 上的 PL/Perl 编译失败 (Victor Wagner) - 使用 Python 3.11 及更高版本修复 PL/Python 编译失败 (Peter Eisentraut) - 添加对使用 Visual Studio 2022 进行构建的支持 (Hans Buschmann) - 允许`。蝙蝠`在我们的 MSVC 构建系统中调用包装脚本,而无需先更改其目录 (Anton Voloshin, Andrew Dunstan)