Appendix E. 版本訊息

Table of Contents
E.1. 版本 8.0
E.2. 版本 7.4.6
E.3. 版本 7.4.5
E.4. 版本 7.4.4
E.5. 版本 7.4.3
E.6. 版本 7.4.2
E.7. 版本 7.4.1
E.8. 版本 7.4
E.9. 版本 7.3.8
E.10. 版本 7.3.7
E.11. 版本 7.3.6
E.12. 版本 7.3.5
E.13. 版本 7.3.4
E.14. 版本 7.3.3
E.15. 版本 7.3.2
E.16. 版本 7.3.1
E.17. 版本 7.3
E.18. 版本 7.2.6
E.19. 版本 7.2.5
E.20. 版本 7.2.4
E.21. 版本 7.2.3
E.22. 版本 7.2.2
E.23. 版本 7.2.1
E.24. 版本 7.2
E.25. 版本 7.1.3
E.26. 版本 7.1.2
E.27. 版本 7.1.1
E.28. 版本 7.1
E.29. 版本 7.0.3
E.30. 版本 7.0.2
E.31. 版本 7.0.1
E.32. 版本 7.0
E.33. 版本 6.5.3
E.34. 版本 6.5.2
E.35. 版本 6.5.1
E.36. 版本 6.5
E.37. 版本 6.4.2
E.38. 版本 6.4.1
E.39. 版本 6.4
E.40. 版本 6.3.2
E.41. 版本 6.3.1
E.42. 版本 6.3
E.43. 版本 6.2.1
E.44. 版本 6.2
E.45. 版本 6.1.1
E.46. 版本 6.1
E.47. 版本 6.0
E.48. 版本 1.09
E.49. 版本 1.02
E.50. 版本 1.01
E.51. 版本 1.0
E.52. Postgres95版本 0.03
E.53. Postgres95版本 0.02
E.54. Postgres95版本 0.01

E.1. 版本 8.0

發佈日期: 2005-01-19

E.1.1. 概述

這個版本中的主要變化:

Microsoft Windows 本機伺服器

這是第一個可以在 Microsoft Windows 上作為伺服器本地執行的 PostgreSQL 版本。 它可以以 Windows 服務執行。 這個版本支援 NT 為基礎的 Windows 版本,比如Windows 2000,,Windows XP, 和 Windows 2003。它不支援更早的版本,比如 Windows 95Windows 98,和 Windows ME 等,因為這些操作系統沒有支援 PostgreSQL 的足夠的基礎設施。 還有一個獨立的安裝器項目以簡化 Windows 上的安裝 — 參閱 http://pgfoundry.org/projects/pginstaller

儘管在我們的發佈週期裡認真測試過, 但是 Windows 移植仍然沒有像 Unix 平台下 PostgreSQL 那麼多年的使用經驗, 因此,應該像新產品一樣小心對待它。

以前的版本要求 Unix 模擬工具 Cygwin 才能支援 Win32。 PostgreSQL 多年來一直支援 Win32 上的本機客戶端。

保存點

保存點允許回滾一個交易的特定部分而不會影響交易其它的部分。 以前的版本沒有這樣的功能;除了退出整個交易外,我們無法從交易中的一個語句的失效恢復。 這個特性用於那些要求複雜的交易控制的應用作者特別有用。

即時恢復

在以前的版本裡,我們沒有辦法從磁盤崩潰中恢復, 除非從以前的備份中恢復或者使用一個獨立的複製伺服器。 即時恢復允許對伺服器進行連續的備份。您既可以恢復到失敗那個點,也可以恢復到以前的任意交易。

資料表空間

資料表空間允許管理員選擇用於儲存資料表,索引和整個資料庫所用的文件系統。 這樣做改善了性能以及提高了對磁盤空間使用的控制。 以前的版本使用 initlocation 和手工的符號連接用於這樣的任務。

改進的緩衝區管理,CHECKPOINTVACUUM

這個版本有著更聰明的緩衝區替換策略,它可以更好地利用可用地共享緩衝區並且改進性能。 vacuum和checkpoint對性能的影響也降低了。

改變字串的類型

現在我們可以用 ALTER TABLE 修改字串的資料類型。

新的 Perl 伺服器端編程語言

新版本的 PL/Perl 伺服器端編程語言現在支援永久的,共享儲存區,觸發器, 返回記錄和記錄數組,以及 SPI 調用。

COPY 裡的逗號分隔數值(CSV)支援

COPY 現在可以讀寫逗號分隔數值(CSV)文件。它還具有解析非標準引號包圍和非標準分隔字元的靈活性。

E.1.2. 移植到版本 8.0

對於使用任何以前版本的用戶來說,需要使用 pg_dump 進行一次轉儲/恢復。

請注意下列不兼容:

  • READ COMMITTED 串行化模式裡, 易失函數現在看到的是目前交易在函數內每條語句開始的時候提交的結果, 而不是調用函數的交互命令開始的時候提交的結果。

  • 聲明為 STABLE 或者 IMMUTABLE 的函數總是使用調用查詢的快照, 因此無法看到調用查詢開始之後的行為的結果,不管是自己交易內部的還是其它交易的。 這樣的函數還必須是只讀的,意味著它除了使用 SELECT 之外不能使用任何其它 SQL 命令。

  • 不能推遲的 AFTER 觸發器現在是在出發他們的查詢結束後立即出發, 而不是在完成目前交互命令的時候。如果觸發觸發器的查詢在一個函數里,那麼就和以前有所不同: 觸發器是在函數繼續其下一步操作之前調用的。

  • 伺服器配置參數 virtual_hosttcpip_socket 被更通用的參數 listen_addresses 取代。還有,現在伺服器預設時在 localhost 上監聽, 它在很多場合下消除了 postmaster 開關 -i 的需要。

  • 伺服器配置參數 SortMemVacuumMem 改名為 work_memmaintenance_work_mem 以便更好地反映它們地用途。原來的兩個仍然在 SETSHOW 裡支援。

  • 伺服器配置參數 log_pidlog_timestamp,和 log_source_port 現在刪除掉了, 用一個更靈活的 log_line_prefix 替換掉了。

  • 伺服器配置參數 syslog,用一個更有邏輯性的 log_destination 替換掉了,用於配置日誌輸出目的地。

  • 伺服器配置參數 log_statement 修改了一些行為,這樣它可以限制只記錄資料庫修改或者資料定義語句。 伺服器配置參數 log_duration 現在只是在 log_statement 打印查詢的時候才答應。

  • 伺服器配置參數 max_expr_depthmax_stack_depth 替換,它測量的是堆棧的大小,而不是堆棧深度的多少。 這樣就避免了會話因為遞規函數導致的堆棧溢出而終止。

  • length() 函數不再計算 CHAR(n) 數值裡面結尾的空白。

  • 把一個整數轉換成 BIT(N) 選取最右邊 N 位整數,而不是以前的最左邊 N 位。

  • 現在 UPDATE 一個 NULL 數組的元素或者片斷生成一個非 NULL 的數組結果, 也就是一個只包含賦值了的位置的數組。

  • 在匹配 GROUP BY 名字的時候,首先優先選擇本地的 FROM 字串,然後是 SELECT 的別名和上層子查詢的 FROM。

  • 數組輸入值的語法檢查變嚴了。以前那些在奇怪位置有著奇怪結果的,允許輸入的垃圾現在導致一個錯誤。 孔字串元素現在必須寫成 "",而不是什麼都不寫。 還改變了包圍數組元素的空白的行為:末尾的空白現在被忽略, 開頭的也是(總是被忽略)。

  • 整數算術操作的溢出現在被檢測並會報告一個錯誤。

  • 與單字元資料類型 "char" 關聯的算術操作運算符被刪除。

  • extract() 函數(也叫作 date_part)現在給 BC (公元前)的日期返回合適的年份。 以前它返回比正確年份小一年。現在這個函數也返回正確的千年和世紀值。

  • CIDR 值現在必須是非掩碼位為零。比如,我們不再允許 204.248.199.1/31 作為一個 CIDR 數值。 這樣的數值將不會被 PostgreSQL 接受並且被拒絕。

  • 現在 EXECUTE 返回一個匹配執行的語句的完成標誌。

  • psql\copy 命令現在讀寫查詢的 stdin/stdout, 而不是 psqlstdin/stdout。 以前的行為可以透過新的 pstdin/pstdout 參數獲取。

  • JDBC 客戶端接口從核心版本中刪除,現在它在 http://jdbc.postgresql.org 承載。

  • Tcl 客戶端接口從核心版本中刪除,現在有幾個 Tcl 接口在 http://gborg.postgresql.org 承載。

  • 伺服器現在使用自己的時區資料庫,而不是操作系統使用的那個。 這樣將在不同平台上提供一致的行為。在大多數情況下,時區行為上應該沒有什麼可見的區別, 只有 SET/SHOW TimeZone 使用的時區名字可能和您的平台提供的有些區別。

  • Configure 的線程選項不再需要用戶執行測試或者編輯配置文件了;線程選項現在是自動探測的。

  • 既然已經實現了資料表空間,initlocation 就刪除掉了。

  • 數組值輸入的語法檢查處理相應嚴格化了。以前允許的那些在奇怪位置輸入並導致奇怪結果的垃圾現在會生成一個 ERROR。 空字串值現在必須寫成 "",而不是以前那樣可以啥都不寫。 還改變了在數組元素周圍包圍的空白的行為:結尾的空白現在總是忽略,和開頭的空白類似(以前總是忽略)。

  • READ COMMITTED 串行模式下,易失的函數現在看到函數里每個語句開始的時候並發的交易提交的結果, 而不是調用函數的交互命令開始的時候的東西。

  • 聲明為 STABLE 或者 IMMUTABLE 的函數總是使用調用它的查詢的快照, 因此不會看到在調用查詢開始之後的動作的效果,不管是他們自己的交易裡面的還是其它交易裡面的。 這樣的函數也必須是只讀的,這就意味著它不能使用除了 SELECT 之外的 SQL 命令。

  • 不推遲的 AFTER 觸發器現在在觸發之的查詢完成後立即觸發,而不是在完成目前的交互命令之後。 這種做法下,如果觸發之的查詢發生在一個函數梨,那麼就有區別:觸發器在函數進行它的下一個操作之前就觸發了。

E.1.3. 廢棄的特性

PostgreSQL 的有些方面行為已經認為是不夠優化的。 為了向後兼容,這些東西還沒有從 8.0 裡面刪除,但是我們認為它們已經廢棄了並且將在下一個主版本中刪除。

  • 8.1 版本將刪除函數 to_char(interval, text)

  • 伺服器現在警告傳遞給 oid/float4/float8 資料類型的空字串,但是和以前一樣把它們解析為零。 在下一個主版本裡,空字串將被認為是這些資料類型的無效輸入。

  • 預設時,PostgreSQL 8.0 以及更早的版本裡的資料表都帶著 OID 建立。 在下一個版本裡,情況將不是這樣:要建立一個包含 OID 的資料表, 必須聲明 WITH OIDS 子句或者必須打開 default_with_oids 配置參數。 如果用戶的資料表因為相容性原因需要使用 OID,那麼我們鼓勵用戶明確聲明 WITH OIDS, 這樣方便和將來的 PostgreSQL 版本兼容。

E.1.4. 修改

下面是您會找到的在 8.0 裡和以前的主版本之間的變化細節。

E.1.4.1. 性能改善

  • 支援跨資料類型的索引使用 (Tom)

    在這個改變之前,如果資料類型不是精確匹配,那麼許多查詢將不能使用索引。 這個改進令索引的使用更加直觀和連貫。

  • 改善緩衝得新的緩衝區替換策略 (Jan)

    以前的版本使用目前最少使用(LRU)緩衝來保持最近引用過的頁面在內存裡。 LRU 算法並不考慮特定緩衝項訪問的次數。大資料表的選擇可能會導致緩衝頁出局。 新的緩衝算法使用四個獨立的列資料表以記錄最近使用的和最頻繁使用的緩衝頁, 並且根據工作負荷動態地優化它們。這樣可以讓共享的緩衝區的使用更加高效。 以前測試過共享緩衝區大小的管理員應該重新測試,以便使用新的緩衝替換策略。

  • 增加了新的子進程來週期性的寫入髒緩衝區以減少 checkpoint 的寫入 (Jan)

    在以前的版本裡,檢查點進程會每隔幾分鐘執行一次,把所有髒緩衝區的資料寫到操作系統的緩衝區, 然後把所有操作系統的髒緩衝區的資料都刷新到磁盤上。 這樣就會導致週期性地磁盤使用高峰,因此也會影響性能。 新的代碼使用一個後台寫進程以穩定的步調跟蹤磁盤寫,這樣檢查點需要寫的髒頁面就少得多。 還有,新的代碼並不發出全局的 sync() 調用,而只是 fsync() 那些自上次檢查點以來寫入過的文件。 這樣應該可以改善性能並且在檢查點的時候最小化性能的下降。

  • 增加了拖延 vacuum 的能力,降低了對性能的影響 (Jan)

    在繁忙的系統上,VACUUM 進行大量的 I/O 請求,可能會導致對其它用戶的性能的影響。 這個版本允許您降低 VACUUM 的速度,這樣它就會少用一些資源, 不過這個會延長 VACUUM 的時間。

  • 改善了重複鍵字的 B-tree 索引的性能(Dmitry Tkach, Tom)

    這個變化改進了索引中存在多個重複值的索引掃瞄。

  • 規劃時使用動態生成的資料表大小估計(Tom)

    以前的規劃器對資料表大小的估計使用最後一次 VACUUM 或者 ANALYZE 看到的數值,包括實際資料表大小(頁面數)和行數。 現在,目前實際資料表大小是從內核獲取的,而行數是用資料表大小乘以最後一次 VACUUM 或者 ANALYZE 看到的行密度(每頁的行數)得到的。 這樣可以獲得更可靠的估計,以免自最後一次清理命令以來資料表的大小有顯著改變。

  • 改善了帶有 OR 子句的索引使用 (Tom)

    這個變化允許優化器在帶有許多 OR 子句的語句中使用索引,而在以前是不可能的。 如果聲明了第一個字串並且第二個字串是一個 OR 字句的一部分,它還可以使用多字串索引。

  • 改進部分索引子句的匹配 (Tom)

    現在伺服器對涉及複雜 WHERE 子句的查詢使用部分索引的時候更聰明。

  • 改善了 GEQO 優化器的性能 (Tom)

    GEQO 優化器用於連接很多資料表(預設是十二個)。這個版本提高了分析查詢的速度,降低了用於優化的時間。

  • 雜項的優化器改進

    這裡可不夠地方列出所有小的改進,但是大量的特例在這個版本裡比以前的版本干的要好。

  • 改進了 C 函數的裝載速度 (Tom)

    這個版本現在使用一個散列來查找外部裝載的 C 函數的訊息。 這樣就改進了他們的裝載速度,和那些本身是伺服器一部分的內置函數一樣快。

  • 增加了類型相關的 ANALYZE 統計功能 (Mark Cave-Ayland)

    這個特性允許為非標準資料類型有更靈活的統計生成。

  • ANALYZE 現在為資料表達式索引蒐集統計(Tom)

    Expression indexes (also called functional indexes) allow users to index not just columns but the results of expressions and function calls. With this release, the optimizer can gather and use statistics about the contents of expression indexes. This will greatly improve the quality of planning for queries in which an expression index is relevant.

  • New two-stage sampling method for ANALYZE (Manfred Koizar)

    This gives better statistics when the density of valid rows is very different in different regions of a table.

  • 加快了 TRUNCATE (Tom)

    這個修補彌補了一些在 7.4 裡觀察到的性能丟失,並且仍然保持了 TRUNCATE 的交易安全性。

E.1.4.2. 伺服器修改

  • 增加了 WAL 文件歸檔和及時恢復 (Simon Riggs)

  • 增加了資料表空間,管理員可以控制磁盤佈局 (Gavin)

  • Add a built-in log rotation program (Andreas Pflug)

    It is now possible to log server messages conveniently without relying on either syslog or an external log rotation program.

  • Add new read-only server configuration parameters to show server compile-time settings: block_size, integer_datetimes, max_function_args, max_identifier_length, max_index_keys (Joe)

  • Make quoting of sameuser, samegroup, and all remove special meaning of these terms in pg_hba.conf (Andrew)

  • Use clearer IPv6 name ::1/128 for localhost in default pg_hba.conf (Andrew)

  • Use CIDR format in pg_hba.conf examples (Andrew)

  • Rename server configuration parameters SortMem and VacuumMem to work_mem and maintenance_work_mem (Old names still supported) (Tom)

    This change was made to clarify that bulk operations such as index and foreign key creation use maintenance_work_mem, while work_mem is for workspaces used during query execution.

  • Allow logging of session disconnections using server configuration parameter log_disconnections (Andrew)

  • Add new server configuration parameter log_line_prefix to allow control of information emitted in each log line (Andrew)

    Information includes user name, database name, remote IP address, and session start time.

  • Remove server configuration parameters log_pid, log_timestamp, log_source_port; functionality superseded by log_line_prefix (Andrew)

  • Replace the virtual_host and tcpip_socket parameters with a unified listen_addresses parameter (Andrew, Tom)

    virtual_host could only specify a single IP address to listen on. listen_addresses allows multiple addresses to be specified.

  • Listen on localhost by default, which eliminates the need for the -i postmaster switch in many scenarios (Andrew)

    Listening on localhost (127.0.0.1) opens no new security holes but allows configurations like Windows and JDBC, which do not support local sockets, to work without special adjustments.

  • Remove syslog server configuration parameter, and add more logical log_destination variable to control log output location (Magnus)

  • Change server configuration parameter log_statement to take values all, mod, ddl, or none to select which queries are logged (Bruce)

    This allows administrators to log only data definition changes or only data modification statements.

  • Some logging-related configuration parameters could formerly be adjusted by ordinary users, but only in the "more verbose" direction. They are now treated more strictly: only superusers can set them. However, a superuser may use ALTER USER to provide per-user settings of these values for non-superusers. Also, it is now possible for superusers to set values of superuser-only configuration parameters via PGOPTIONS.

  • Allow configuration files to be placed outside the data directory (mlw)

    By default, configuration files sit in the cluster's top directory. With this addition, configuration files can be placed outside the data directory, easing administration.

  • Plan prepared queries only when first executed so constants can be used for statistics (Oliver Jowett)

    Prepared statements plan queries once and execute them many times. While prepared queries avoid the overhead of re-planning on each use, the quality of the plan suffers from not knowing the exact parameters to be used in the query. In this release, planning of unnamed prepared statements is delayed until the first execution, and the actual parameter values of that execution are used as optimization hints. This allows use of out-of-line parameter passing without incurring a performance penalty.

  • Allow DECLARE CURSOR to take parameters (Oliver Jowett)

    It is now useful to issue DECLARE CURSOR in a Parse message with parameters. The parameter values sent at Bind time will be substituted into the execution of the cursor's query.

  • Fix hash joins and aggregates of inet and cidr data types (Tom)

    Release 7.4 handled hashing of mixed inet and cidr values incorrectly. (This bug did not exist in prior releases because they wouldn't try to hash either data type.)

  • Make log_duration print only when log_statement prints the query (Ed L.)

E.1.4.3. Query Changes

  • Add savepoints (nested transactions) (Alvaro)

  • Unsupported isolation levels are now accepted and promoted to the nearest supported level (Peter)

    The SQL specification states that if a database doesn't support a specific isolation level, it should use the next more restrictive level. This change complies with that recommendation.

  • Allow BEGIN WORK to specify transaction isolation levels like START TRANSACTION (Bruce)

  • Fix table permission checking for cases in which rules generate a query type different from the originally submitted query (Tom)

  • Implement dollar quoting to simplify single-quote usage (Andrew Tom, David Fetter)

    In previous releases, because single quotes had to be used to quote a function's body, the use of single quotes inside the function text required use of two single quotes or other error-prone notations. With this release we add the ability to use "dollar quoting" to quote a block of text. The ability to use different quoting delimiters at different nesting levels greatly simplifies the task of quoting correctly, especially in complex functions. Dollar quoting can be used anywhere quoted text is needed.

  • Make CASE val WHEN compval1 THEN ... evaluate val only once (Tom)

    CASE no longer evaluates the test expression multiple times. This has benefits when the expression is complex or is volatile.

  • Test HAVING before computing target list of an aggregate query (Tom)

    Fixes improper failure of cases such as SELECT SUM(win)/SUM(lose) ... GROUP BY ... HAVING SUM(lose) > 0. This should work but formerly could fail with divide-by-zero.

  • Replace max_expr_depth parameter with max_stack_depth parameter, measured in kilobytes of stack size (Tom)

    This gives us a fairly bulletproof defense against crashing due to runaway recursive functions. Instead of measuring the depth of expression nesting, we now directly measure the size of the execution stack.

  • Allow arbitrary row expressions (Tom)

    This release allows SQL expressions to contain arbitrary composite types, that is, row values. It also allows functions to more easily take rows as arguments and return row values.

  • Allow LIKE/ILIKE to be used as the operator in row and subselect comparisons (Fabien Coelho)

  • Avoid locale-specific case conversion of basic ASCII letters in identifiers and keywords (Tom)

    This solves the "Turkish problem" with mangling of words containing I and i. Folding of characters outside the 7-bit-ASCII set is still locale-aware.

  • Improve syntax error reporting (Fabien, Tom)

    Syntax error reports are more useful than before.

  • Change EXECUTE to return a completion tag matching the executed statement (Kris Jurka)

    Previous releases return an EXECUTE tag for any EXECUTE call. In this release, the tag returned will reflect the command executed.

  • Avoid emitting NATURAL CROSS JOIN in rule listings (Tom)

    Such a clause makes no logical sense, but in some cases the rule decompiler formerly produced this syntax.

  • Allow arbitrary row expressions (Tom)

    This allows columns to contain arbitrary composite types like rows from other tables. It also allows functions to more easily take rows as arguments and return row values.

E.1.4.4. Object Manipulation Changes

  • Add COMMENT ON for casts, conversions, languages, operator classes, and large objects (Christopher)

  • Add new server configuration parameter default_with_oids to control whether tables are created with OIDs by default (Neil)

    This allows administrators to control whether CREATE TABLE commands create tables with or without OID columns by default. (Note: the current factory default setting for default_with_oids is TRUE, but the default will become FALSE in future releases.)

  • Add WITH / WITHOUT OIDS clause to CREATE TABLE AS (Neil)

  • Allow ALTER TABLE DROP COLUMN to drop an OID column (ALTER TABLE SET WITHOUT OIDS still works) (Tom)

  • Allow composite types as table columns (Tom)

  • Allow ALTER ... ADD COLUMN with defaults and NOT NULL constraints; works per SQL spec (Rod)

    It is now possible for ADD COLUMN to create a column that is not initially filled with NULLs, but with a specified default value.

  • Add ALTER COLUMN TYPE to change column's type (Rod)

    It is now possible to alter a column's data type without dropping and re-adding the column.

  • Allow multiple ALTER actions in a single ALTER TABLE command (Rod)

    This is particularly useful for ALTER commands that rewrite the table (which include ALTER COLUMN TYPE and ADD COLUMN with a default). By grouping ALTER commands together, the table need be rewritten only once.

  • Allow ALTER TABLE to add SERIAL columns (Tom)

    This falls out from the new capability of specifying defaults for new columns.

  • Allow changing the owners of aggregates, conversions, databases, functions, operators, operator classes, schemas, types, and tablespaces (Christopher, Euler Taveira de Oliveira)

    Previously this required modifying the system tables directly.

  • Allow temporary object creation to be limited to SECURITY DEFINER functions (Sean Chittenden)

  • Add ALTER TABLE ... SET WITHOUT CLUSTER (Christopher)

    Prior to this release, there was no way to clear an auto-cluster specification except to modify the system tables.

  • Constraint/Index/SERIAL names are now table_column_type with numbers appended to guarantee uniqueness within the schema (Tom)

    The SQL specification states that such names should be unique within a schema.

  • Add pg_get_serial_sequence() to return a SERIAL column's sequence name (Christopher)

    This allows automated scripts to reliably find the SERIAL sequence name.

  • Warn when primary/foreign key data type mismatch requires costly lookup

  • New ALTER INDEX command to allow moving of indexes between tablespaces (Gavin)

  • Make ALTER TABLE OWNER change dependent sequence ownership too (Alvaro)

E.1.4.5. Utility Command Changes

  • Allow CREATE SCHEMA to create triggers, indexes, and sequences (Neil)

  • Add ALSO keyword to CREATE RULE (Fabien Coelho)

    This allows ALSO to be added to rule creation to contrast it with INSTEAD rules.

  • Add NOWAIT option to LOCK (Tatsuo)

    This allows the LOCK command to fail if it would have to wait for the requested lock.

  • Allow COPY to read and write comma-separated-value (CSV) files (Andrew, Bruce)

  • Generate error if the COPY delimiter and NULL string conflict (Bruce)

  • GRANT/REVOKE behavior follows the SQL spec more closely

  • Avoid locking conflict between CREATE INDEX and CHECKPOINT (Tom)

    In 7.3 and 7.4, a long-running B-tree index build could block concurrent CHECKPOINTs from completing, thereby causing WAL bloat because the WAL log could not be recycled.

  • Database-wide ANALYZE does not hold locks across tables (Tom)

    This reduces the potential for deadlocks against other backends that want exclusive locks on tables. To get the benefit of this change, do not execute database-wide ANALYZE inside a transaction block (BEGIN block); it must be able to commit and start a new transaction for each table.

  • Generate error if the COPY delimiter and NULL string conflict (Bruce)

  • Allow COPY to read comma-separated-value (CSV) files (Andrew, Bruce)

  • REINDEX does not exclusively lock the index's parent table anymore

    The index itself is still exclusively locked, but readers of the table can continue if they are not using the particular index being rebuilt.

  • Erase MD5 user passwords when a user is renamed (Bruce)

    PostgreSQL uses the user name as salt when encrypting passwords via MD5. When a user's name is changed, the salt will no longer match the stored MD5 password, so the stored password becomes useless. In this release a notice is generated and the password is cleared. A new password must then be assigned if the user is to be able to log in with a password.

  • New pg_ctl kill option for Windows (Andrew)

    Windows does not have a kill command to send signals to backends so this capability was added to pg_ctl.

  • Information schema improvements

  • Add --pwfile option to initdb so the initial password can be set by GUI tools (Magnus)

  • Detect locale/encoding mismatch in initdb (Peter)

  • Add register command to pg_ctl to register Windows operating system service (Dave Page)

E.1.4.6. Data Type and Function Changes

  • More complete support for composite types (row types) (Tom)

    Composite values can be used in many places where only scalar values worked before.

  • Reject non-rectangular array literals as erroneous (Joe)

    Formerly, array_in would silently build a surprising result.

  • Overflow in integer arithmetic operations is now detected (Tom)

  • The arithmetic operators associated with the single-byte "char" data type have been removed.

    Formerly, the parser would select these operators in many situations where an "unable to select an operator" error would be more appropriate, such as null * null. If you actually want to do arithmetic on a "char" column, you can cast it to integer explicitly.

  • Syntax checking of array input processing considerably tighened up (Joe)

    Junk that was previously allowed in odd places with odd results now causes an ERROR, for example, non-whitespace after the closing right brace.

  • Empty-string array element values must now be written as "", rather than writing nothing (Joe)

    Formerly, both ways of writing an empty-string element value were allowed, but now a quoted empty string is required. The case where nothing at all appears will probably be considered to be a NULL element value in some future release.

  • Array element trailing whitespace is now ignored (Joe)

    Formerly leading whitespace was ignored, but trailing whitespace between an element and the delimiter or right brace was significant. Now trailing whitespace is also ignored.

  • Emit array values with explicit array bounds when lower bound is not one (Joe)

  • Accept YYYY-monthname-DD as a date string (Tom)

  • Make netmask and hostmask functions return maximum-length mask length (Tom)

  • Change factorial function to return numeric (Gavin)

    Returning numeric allows the factorial function to work for a wider range of input values.

  • to_char/to_date() date conversion improvements (Kurt Roeckx, Fabien Coelho)

  • Make length() disregard trailing spaces in CHAR(n) (Gavin)

    This change was made to improve consistency: trailing spaces are semantically insignificant in CHAR(n) data, so they should not be counted by length().

  • Warn about empty string being passed to OID/float4/float8 data types (Neil)

    8.1 will throw an error instead.

  • Allow leading or trailing whitespace in int2/int4/int8/float4/float8 input routines (Neil)

  • Better support for IEEE Infinity and NaN values in float4/float8 (Neil)

    These should now work on all platforms that support IEEE-compliant floating point arithmetic.

  • Add week option to date_trunc() (Robert Creager)

  • Fix to_char for 1 BC (previously it returned 1 AD) (Bruce)

  • Fix to_char for 1 BC (previously it returned 1 AD) (Bruce)

  • Fix date_part(year) for BC dates (previously it returned one less than the correct year) (Bruce)

  • Fix date_part() to return the proper millennium and century (Fabien Coelho)

    In previous versions, the century and millennium results had a wrong number and started in the wrong year, as compared to standard reckoning of such things.

  • Add ceiling() as an alias for ceil(), and power() as an alias for pow() for standards compliance (Neil)

  • Change ln(), log(), power(), and sqrt() to emit the correct SQLSTATE error codes for certain error conditions, as specified by SQL:2003 (Neil)

  • Add width_bucket() function as defined by SQL:2003 (Neil)

  • Add generate_series() functions to simplify working with numeric sets (Joe)

  • Fix upper/lower/initcap() functions to work with multibyte encodings (Tom)

  • Add boolean and bitwise integer AND/OR aggregates (Fabien Coelho)

  • New session information functions to return network addresses for client and server (Sean Chittenden)

  • Add function to determine the area of a closed path (Sean Chittenden)

  • Add function to send cancel request to other backends (Magnus)

  • Add interval plus datetime operators (Tom)

    The reverse ordering, datetime plus interval, was already supported, but both are required by the SQL standard.

  • Casting an integer to BIT(N) selects the rightmost N bits of the integer (Tom)

    In prior releases, the leftmost N bits were selected, but this was deemed unhelpful, not to mention inconsistent with casting from bit to int.

  • Require CIDR values to have all non-masked bits be zero (Kevin Brintnall)

E.1.4.7. 伺服器端語言變化

  • READ COMMITTED 串行模式下,易失的函數現在看到函數里每個語句開始的時候並發的交易提交的結果, 而不是調用函數的交互命令開始的時候的東西。

  • 聲明為 STABLE 或者 IMMUTABLE 的函數總是使用調用它的查詢的快照, 因此不會看到在調用查詢開始之後的動作的效果,不管是他們自己的交易裡面的還是其它交易裡面的。 這樣的函數也必須是只讀的,這就意味著它不能使用除了 SELECT 之外的 SQL 命令。 把函數聲明為 STABLE 或者 IMMUTABLE 而不是 VOLATILE 有可觀的性能提升。

  • 不推遲的 AFTER 觸發器現在在觸發之的查詢完成後立即觸發,而不是在完成目前的交互命令之後。 這種做法下,如果觸發之的查詢發生在一個函數梨,那麼就有區別:觸發器在函數進行它的下一個操作之前就觸發了。 比如,如果一個函數向一個資料表裡插入了一個新行,那麼任何未推遲的外鍵檢查將在函數繼續之前發生。

  • Allow function parameters to be declared with names (Dennis Bjorklund)

    This allows better documentation of functions. Whether the names actually do anything depends on the specific function language being used.

  • Allow PL/pgSQL parameter names to be referenced in the function (Dennis Bjorklund)

    This basically creates an automatic alias for each named parameter.

  • Do minimal syntax checking of PL/pgSQL functions at creation time (Tom)

    This allows us to catch simple errors sooner.

  • More support for composite types (row and record variables) in PL/pgSQL

    For example, it now works to pass a rowtype variable to another function as a single variable.

  • Default values for PL/pgSQL variables can now reference previously declared variables

  • Improve parsing of PL/pgSQL FOR loops (Tom)

    Parsing is now driven by presence of ".." rather than datatype of FOR variable. This makes no difference for correct functions, but should result in more understandable error messages when a mistake is made.

  • Major overhaul of PL/Perl server-side language (Command Prompt, Andrew Dunstan)

  • In PL/Tcl, SPI commands are now run in subtransactions. If an error occurs, the subtransaction is cleaned up and the error is reported as an ordinary Tcl error, which can be trapped with catch. Formerly, it was not possible to catch such errors.

  • Accept ELSEIF in PL/pgSQL (Neil)

    Previously PL/pgSQL only allowed ELSIF, but many people are accustomed to spelling this keyword ELSEIF.

E.1.4.8. psql 變化

  • Improve psql information display about database objects (Christopher)

  • Allow psql to display group membership in \du and \dg (Markus Bertheau)

  • Prevent psql \dn from showing temporary schemas (Bruce)

  • Allow psql to handle tilde user expansion for file names (Zach Irmen)

  • Allow psql to display fancy prompts, including color, via readline (Reece Hart, Chet Ramey)

  • Make psql \copy match COPY command syntax

  • Show the location of syntax errors (Fabien Coelho, Tom)

  • Add CLUSTER information to psql \d display

  • Change psql \copy stdin/stdout to read from command input/output (Bruce)

  • Add pstdin/pstdout to read from psql's stdin/stdout (Mark Feit)

  • Add global psql configuration file, psqlrc.sample

    This allows a central file where global psql startup commands can be stored.

  • Have psql \d+ indicate if the table has an OID column (Neil)

  • On Windows, use binary mode in psql when reading files so control-Z is not seen as end-of-file

  • Have \dn+ show permissions and description for schemas (Dennis Bjorklund)

  • Improve tab completion support (Stefan Kaltenbrunn, Greg Sabino Mullane)

  • Allow boolean settings to be set using upper or lower case (Michael Paesold)

E.1.4.9. pg_dump 改變

  • Use dependency information to improve the reliability of pg_dump (Tom)

    This should solve the longstanding problems with related objects sometimes being dumped in the wrong order.

  • Have pg_dump output objects in alphabetical order if possible (Tom)

    This should make it easier to identify changes between dump files.

  • Allow pg_restore to ignore some SQL errors (Fabien Coelho)

    This makes pg_restore's behavior similar to the results of feeding a pg_dump output script to psql. In most cases, ignoring errors and plowing ahead is the most useful thing to do. Also added was a pg_restore option to give the old behavior of exiting on an error.

  • pg_restore -l display now includes objects' schema names

  • New begin/end markers in pg_dump text output (Bruce)

  • Add start/stop times for pg_dump/pg_dumpall in verbose mode (Bruce)

  • Allow most pg_dump options in pg_dumpall (Christopher)

  • Have pg_dump use ALTER OWNER rather than SET SESSION AUTHORIZATION by default (Christopher)

E.1.4.10. libpq Changes

  • Make libpq's SIGPIPE handling thread-safe (Bruce)

  • Add PQmbdsplen() which returns the display length of a character (Tatsuo)

  • Add thread locking to SSL and Kerberos connections (Manfred Spraul)

  • Allow PQoidValue(), PQcmdTuples(), and PQoidStatus() to work on EXECUTE commands (Neil)

  • Add PQserverVersion() to provide more convenient access to the server version number (Greg Sabino Mullane)

  • Add PQprepare/PQsendPrepared() functions to support preparing statements without necessarily specifying the data types of their parameters (Abhijit Menon-Sen)

  • Many ECPG improvements, including SET DESCRIPTOR (Michael)

E.1.4.11. Source Code Changes

  • Allow the database server to run natively on Windows (Claudio, Magnus, Andrew)

  • Shell script commands converted to C versions for Windows support (Andrew)

  • Use --with-docdir to choose installation location of documentation; also allow --infodir (Peter)

  • Create an extension makefile framework (Fabien Coelho, Peter)

    This simplifies the task of building extensions outside the original source tree.

  • Support relocatable installations (Bruce)

    Directory paths for installed files (such as the /share directory) are now computed relative to the actual location of the executables, so that an installation tree can be moved to another place without reconfiguring and rebuilding.

  • Use --with-docdir to choose installation location of documentation; also allow --infodir (Peter)

  • Add --without-docdir to prevent installation of documentation (Peter)

  • Upgrade to DocBook V4.2 SGML (Peter)

  • New PostgreSQL CVS tag (Marc)

    This was done to make it easier for organizations to manage their own copies of the PostgreSQL CVS repository. File version stamps from the master repository will not get munged by checking into or out of a copied repository.

  • Clarify locking code (Manfred Koizar)

  • Buffer manager cleanup (Neil)

  • Decouple platform tests from CPU spinlock code (Bruce, Tom)

  • Add inlined test-and-set code on PA-RISC for gcc (ViSolve, Tom)

  • Improve i386 spinlock code (Manfred Spraul)

  • Clean up spinlock assembly code to avoid warnings from newer gcc releases (Tom)

  • Remove JDBC from source tree; now a separate project

  • Remove the libpgtcl client interface; now a separate project

  • More accurately estimate memory and file descriptor usage (Tom)

  • Improvements to the MAC OS X startup scripts (Ray A.)

  • New fsync() test program (Bruce)

  • Major documentation improvements (Neil, Peter)

  • Remove pg_encoding; not needed anymore

  • Remove pg_id; not needed anymore

  • Remove initlocation; not needed anymore

  • Auto-detect thread flags (no more manual testing) (Bruce)

  • Use Olson's public domain timezone library (Magnus)

  • With threading enabled, use thread flags on Unixware for backend executables too (Bruce)

    Unixware can not mix threaded and non-threaded object files in the same executable, so everything must be compiled as threaded.

  • psql now uses a flex-generated lexical analyzer to process command strings

  • Reimplement the linked list data structure used throughout the backend (Neil)

    This improvs performance by allowing list append operations to be more efficient.

  • Allow dynamically loaded modules to create their own server configuration parameters (Thomas Hallgren)

  • New Brazilian version of FAQ (Euler Taveira de Oliveira)

  • Add French FAQ (Guillaume Lelarge)

  • New pgevent for Windows logging

  • Make libpq and ECPG build as proper shared libraries on OS X (Tom)

E.1.4.12. Contrib Changes

  • Overhaul of contrib/dblink (Joe)

  • contrib/dbmirror improvements (Steven Singer)

  • New contrib/xml2 (John Gray, Torchbox)

  • Updated contrib/mysql

  • New version of contrib/btree_gist (Teodor)

  • New contrib/trgm, trigram matching for PostgreSQL (Teodor)

  • Many contrib/tsearch2 improvements (Teodor)

  • Add double metaphone to contrib/fuzzystrmatch (Andrew)

  • Allow contrib/pg_autovacuum to run as a Windows service (Dave Page)

  • Add functions to contrib/dbsize (Andreas Pflug)

  • Removed contrib/pg_logger: obsoleted by integrated logging subprocess

  • Removed contrib/rserv: obsoleted by various separate projects