2025年9月25日: PostgreSQL 18 釋出!

PostgreSQL 10.4、9.6.9、9.5.13、9.4.18 和 9.3.23 已釋出!

釋出於 2018-05-10,作者:PostgreSQL Global Development Group
PostgreSQL 專案

PostgreSQL 全球開發組釋出了我們資料庫系統所有支援版本的更新,包括 10.4、9.6.9、9.5.13、9.4.18、9.3.23。本次釋出修復了一個安全問題以及過去三個月報告的若干 bug。使用者應計劃在下次方便的停機時間進行更新。

請參閱“更新”部分,瞭解有關安全修復和“不正確的易變性和並行安全性標記”修復的安裝後步驟。

請注意,PostgreSQL 在 10.0 版本釋出時更改了其版本方案,因此從 10.0、10.1、10.2 或 10.3 更新到 10.4 版本被視為次要更新。

安全問題

本次釋出修復了一個安全漏洞

  • CVE-2018-1115:函式 pg_logfile_rotate() 的訪問控制列表過於寬鬆

請參閱下面的“更新”部分,瞭解更新後的步驟。

錯誤修復和改進

本次更新還修復了過去幾個月報告的 50 多個 bug。其中一些問題僅影響 10 版本,但許多問題影響所有支援的版本。

這些修復包括:

  • 修復了多個內建函式不正確的易變性 (volatility) 和並行安全性 (parallel-safety) 標記,以確保正確的查詢計劃最佳化。
  • 對分割槽進行了多項修復,包括潛在的崩潰以及允許將 TRUE 和 FALSE 用作分割槽邊界。
  • 修復了新 TOAST 值可能被分配給一個已刪除但尚未 vacuum 的 TOAST OID 的問題,這將導致類似“toast value nnnnn 的意外塊編號 0(預期為 1)”的錯誤。
  • 修復了 32 位平臺上具有 bigint 標識列的“CREATE TABLE ... LIKE”問題。
  • 修復了查詢重複執行雜湊連線時記憶體洩漏的問題。
  • 修復了使用 GROUPING SET 的查詢相關的多處崩潰。
  • 在提交預備事務時,避免在發生查詢取消或會話終止中斷時失敗。
  • 減少了自動 vacuum 工作程序排程期間的鎖定,這可以防止潛在工作程序併發性的丟失。
  • 修復了 REFRESH MATERIALIZED VIEW CONCURRENTLY 可能執行緩慢的問題。
  • 修復了使用“僅索引掃描 (index-only)”的查詢計劃相關的多處問題。
  • 在 SERIALIZABLE 或 REPEATABLE READ 事務隔離級別下執行時,避免併發 CREATE INDEX CONCURRENTLY 命令發生死鎖。
  • 修復了 SP-GiST 索引的多處問題,包括文字列上的一個與排序規則相關的搜尋。
  • 修復了與計算部分 GiST、SP-GiST 和 Bloom 索引中的元組數量相關的問題。
  • 對邏輯解碼和複製進行了多項修復。
  • 修復了轉儲中列表值 GUC 變數(例如 local_preload_libraries、session_preload_libraries、shared_preload_libraries、temp_tablespaces)的值的錯誤引用。
  • 修復了 pg_stat_activity 的多處問題。
  • 修復了 ecpg 的多處問題。
  • 修復了 pg_recvlogical,以確保與 10 版本之前的 PostgreSQL 版本相容。
  • 修復了 pg_rewind 的多處問題。

本次更新還包含 tzdata 2018d 版本,增加了對巴勒斯坦和南極洲(凱西站)的更新,以及對葡萄牙及其殖民地、恩德伯島、牙買加、特克斯和凱科斯群島以及烏拉圭的歷史修正。

更新

所有 PostgreSQL 更新版本都是累積的。與其它次要版本一樣,使用者不需要轉儲和重新載入其資料庫或使用 pg_upgrade 來應用此更新版本(儘管對於此版本,請參閱關於“易變性和並行安全性標記”的說明);您可以簡單地關閉 PostgreSQL 並更新其二進位制檔案。

跳過了一個或多個更新版本的使用者可能需要執行額外的、更新後的步驟;有關詳細資訊,請參閱早期版本的釋出說明。

CVE-2018-1115 的安裝後步驟

如果您在任何 PostgreSQL 9.6 或 10 版本中安裝了“adminpack”,則需要讓您的資料庫管理員在安裝了“adminpack”的每個資料庫中執行以下命令。

ALTER EXTENSION adminpack UPDATE;

函式標記的安裝後步驟

應標記為“volatile”的函式:

  • cursor_to_xml
  • cursor_to_xmlschema
  • query_to_xml
  • query_to_xml_and_xmlschema
  • query_to_xmlschema

應標記為“parallel-unsafe”的函式:

  • binary_upgrade_create_empty_extension,
  • brin_desummarize_range
  • brin_summarize_new_values
  • brin_summarize_range
  • cursor_to_xml
  • cursor_to_xmlschema
  • gin_clean_pending_list
  • pg_import_system_collations
  • ts_rewrite
  • ts_stat

如果您使用上述任何函式,可以透過以下方式更新標記:

選項 1:在您使用的每個資料庫的“pg_proc”表中手動更新標記。

這些函式。您可以透過以資料庫超級使用者的身份執行以下命令來完成此操作。

/* Functions that should be marked "volatile" */
ALTER FUNCTION pg_catalog.cursor_to_xml(refcursor, int, boolean, boolean, text) VOLATILE;
ALTER FUNCTION pg_catalog.cursor_to_xmlschema(refcursor, boolean, boolean, text) VOLATILE;
ALTER FUNCTION pg_catalog.query_to_xml(text, boolean, boolean, text) VOLATILE;
ALTER FUNCTION pg_catalog.query_to_xml_and_xmlschema(text, boolean, boolean, text) VOLATILE;
ALTER FUNCTION pg_catalog.query_to_xmlschema(text, boolean, boolean, text) VOLATILE;
/* Functions that should be marked "parallel-unsafe" */
ALTER FUNCTION pg_catalog.binary_upgrade_create_empty_extension(text, text, bool, text, _oid, _text, _text) PARALLEL UNSAFE;
ALTER FUNCTION pg_catalog.brin_desummarize_range(regclass, bigint) PARALLEL UNSAFE;
ALTER FUNCTION pg_catalog.brin_summarize_new_values(regclass) PARALLEL UNSAFE;
ALTER FUNCTION pg_catalog.brin_summarize_range(regclass, bigint) PARALLEL UNSAFE;
ALTER FUNCTION pg_catalog.cursor_to_xml(refcursor, int, boolean, boolean, text) PARALLEL UNSAFE;
ALTER FUNCTION pg_catalog.cursor_to_xmlschema(refcursor, boolean, boolean, text) PARALLEL UNSAFE;
ALTER FUNCTION pg_catalog.gin_clean_pending_list(regclass) PARALLEL UNSAFE;
ALTER FUNCTION pg_catalog.pg_import_system_collations(regnamespace) PARALLEL UNSAFE;
ALTER FUNCTION pg_catalog.ts_rewrite(tsquery, text) PARALLEL UNSAFE;
ALTER FUNCTION pg_catalog.ts_stat(text) PARALLEL UNSAFE;
ALTER FUNCTION pg_catalog.ts_stat(text, text) PARALLEL UNSAFE;

選項 2:執行 pg_upgrade 到包含正確標記資料的版本(例如 10.4 及更高版本)。

連結

  • 下載:https://postgres.tw/download/
  • 發行說明:https://postgres.tw/docs/current/static/release.html
  • 安全頁面:https://postgres.tw/support/security/
  • 版本策略:https://postgres.tw/support/versioning/
  • 在 Twitter 上關注 @postgresql:https://twitter.com/postgresql