Release 9.3 Release Date 2013-XX-XX, CURRENT AS OF 2013-04-20 Overview ADD HERE Major enhancements include: The above items are explained in more detail in the sections below. Migration to Version 9.3 A dump/restore using pg_dumpall, or use of pg_upgrade, is required for those wishing to migrate data from any previous release. Version 9.3 contains a number of changes that may affect compatibility with previous releases. Observe the following incompatibilities: ADD HERE here Changes Below you will find a detailed account of the changes between PostgreSQL 9.3 and the previous major release. Server Locking Prevent non-key-field row updates from locking foreign key rows (Álvaro Herrera, Noah Misch, Andres Freund, Alexander Shulgin, Marti Raudsepp) This improves concurrency and reduces the probability of deadlocks. UPDATEs on non-key columns use the new SELECT FOR NO KEY UPDATE lock type, and foreign key checks use the new SELECT FOR KEY SHARE lock mode. Add cache of local locks (Jeff Janes) This speeds lock release at statement completion in transactions that hold many locks; it is particularly useful for pg_dump. Indexes Add SP-GiST support for range data types (Alexander Korotkov) Allow unlogged GiST indexes (Jeevan Chalke) Improve concurrency of hash indexes (Robert Haas) Optimizer Collect and use histograms for range types (Alexander Korotkov) Reduce optimizer overhead by discarding plans with unneeded cheaper startup costs (Tom Lane) Improve optimizer cost estimation for index access (Tom Lane) General Performance Add COPY FREEZE option to avoid the overhead of later marking tuples as committed (Simon Riggs, Jeff Davis) Improve performance of NUMERIC calculations (Kyotaro Horiguchi) Improve grouping of sessions waiting for commit_delay (Peter Geoghegan) This improves the usefulness and behavior of commit_delay. BACKWARD COMPATIBILITY Allow in-memory sorts to use their full memory allocation (Jeff Janes) Users who have set work_mem based on the previous behavior should revisit that setting. Improve performance for transactions creating, rebuilding, or dropping many relations (Jeff Janes, Tomas Vondra) Improve performance of the CREATE TEMPORARY TABLE ... ON COMMIT DELETE ROWS clause by only issuing delete if the temporary table was accessed (Heikki Linnakangas) Have vacuum recheck visibility after it has removed expired tuples (Pavan Deolasee) This increases the chance of a page being marked as all-visible. Split pgstat file in per-database and global files (Tomas Vondra) This reduces the statistics management read and write overhead. Monitoring Add optional ability to checksum data pages and report corruption (Simon Riggs, Jeff Davis, Greg Smith) The checksum option can be set during initdb. Allow pg_terminate_backend() to terminate other backends with the same role (Dan Farina) Previously, only superusers could terminate other sessions. Allow the statistics collector to operate properly in cases where the system clock goes backwards (Tom Lane) Previously statistics collection would stop until the time again reached the previously-stored latest time. Authentication Improve LDAP error reporting and documentation (Peter Eisentraut) Add support for LDAP authentication to be specified in URL format (Peter Eisentraut) Change the ssl_ciphers parameter to start with DEFAULT, rather than ALL, then remove insecure ciphers (Magnus Hagander) It is assumed DEFAULT is more appropriate cipher set. Parse/load pg_ident.conf once, not during each connection (Amit Kapila) This is similar to how pg_hba.conf is processed. Server Settings Dramatically reduce System V shared memory usage (Robert Haas) Instead, on Unix-like systems, mmap() is used for shared memory. This eliminates the requirement of increasing System V shared memory kernel parameters. Allow the postmaster to listen on multiple Unix-domain sockets (Honza Horák) This renames configuration parameter unix_socket_directory to unix_socket_directories, which accepts a list of directories. Add configuration variable lock_timeout to limit lock wait duration (Zoltán Böszörményi) Allow a directory of configuration files to be processed (Magnus Hagander, Greg Smith, Selena Deckelmann) The directory is specified as include_dir in server configuration file. Increase the maximum initdb-configured value for shared_buffers to 128MB (Robert Haas) This is the maximum value initdb attempts to set in postgresql.conf; the previous value was 32MB. Require superuser privileges to set commit_delay because it can now potentially delay other sessions (Simon Riggs) BACKWARD COMPATIBILITY Remove the external PID file on postmaster exit (Peter Eisentraut) Have "session id" in log_line_prefix (%c) always output four hex digits after the period (Bruce Momjian) COMPATIBILITY Replication and Recovery Allow a streaming replication standbys to follow a timeline switch (Heikki Linnakangas) This allows streaming standbys to feed from newly-promoted slaves. Previously slaves required access to a WAL archive directory to accomplish this. Add SQL functions pg_backup_in_progress() and pg_backup_start_time() (Gilles Darold) These functions report the status of base backups. Improve performance of streaming log shipping with synchronous_commit disabled (Andres Freund) Allow much faster promotion of a streaming standby to primary (Simon Riggs, Kyotaro Horiguchi) Add the last checkpoint's redo location to pg_controldata's output (Fujii Masao) This information is useful for determining the WAL files needed for restore. Allow tooling like pg_receivexlog to run on computers with different architectures (Heikki Linnakangas) Have pg_basebackup --write-recovery-conf output a minimal recovery.conf (Zoltán Böszörményi, Magnus Hagander) This simplifies setting up a standby server. Allow pg_receivexlog and pg_basebackup -X to handle streaming timeline switches (Heikki Linnakangas) Add wal_receiver_timeout parameter to control the WAL receiver timeout (Amit Kapila) This allows more rapid detection of connection failure. No longer set wal_receiver_status_interval? Rename replication_timeout to wal_sender_timeout (Amit Kapila) BACKWARD COMPATIBILITY This setting controls the WAL sender timeout. Write-Ahead Log (WAL) Store WAL in a continuous stream, rather than skipping the last 16MB segment every 4GB (Heikki Linnakangas) BACKWARD COMPATIBLE BREAK If you have WAL backup or restore scripts that took the skipping into account, they need to be adjusted. Change the WAL record format to allow splitting the record header across pages (Heikki Linnakangas) The new format is slightly more compact. Queries Implement SQL-standard LATERAL for FROM-clause subqueries and function calls (Tom Lane) This is useful in allowing FROM subqueries and functions to reference output from tables in the FROM clause. The LATERAL keyword is optional for functions. Add support for piping COPY and psql \copy to/from an external program (Etsuro Fujita) Improve query string error location reporting (Tom Lane) Only CREATE SCHEMA ... IF NOT EXISTS? If so, remove it. Object Manipulation Add support to event triggers (Dimitri Fontaine, Robert Haas, Álvaro Herrera) This allows C functions to be called when specific commands are run. Allow a multi-row VALUES clause in rules to reference OLD/NEW (Tom Lane) Add CREATE SCHEMA ... IF NOT EXISTS clause (Fabrízio de Royes Mello) Throw an error if expiring tuple is again updated or deleted (Kevin Grittner) DETAILS? BACKWARD INCOMPATIBILITY Have REASSIGN OWNED also change ownership of shared objects (Álvaro Herrera) <link linkend="SQL-CREATETABLE"><command>CREATE TABLE</></link> No longer output messages about implicit index and sequence creation (Robert Haas) These messages now appear with DEBUG1-level output. Allow CREATE TABLE IF NOT EXISTS to succeed for a non-existent schema (Bruce Momjian) Previously, it threw an error if the schema did not exist. Constraints Change ON UPDATE SET NULL/SET DEFAULT foreign key actions to affect all referenced columns, not just those referenced in the UPDATE (Tom Lane) Previously only columns referenced in the UPDATE were set to null or DEFAULT. BACKWARD COMPATIBILITY CHANGE Provide clients with constraint violation details as separate fields (Pavel Stehule) This allows clients to retrieve table, column, data type, or constraint name error details. Previously such information had to be extracted from error strings. Client language support is required to access these fields. Internally store default foreign key matches (non-FULL, non-PARTIAL) as "simple" (Tom Lane) These were previously stored as "<unspecified>". This changes the value stored in system column pg_constraint.confmatchtype. BACKWARD COMPATIBILITY CHANGE <command>ALTER</> Add the ALTER TYPE ... IF NOT EXISTS clause when adding enumerated type labels (Andrew Dunstan) This is useful for conditional label creation in transaction blocks. Add ALTER ROLE ALL SET to add settings to all users (Peter Eisentraut) This allows settings to apply to all users in all databases. ALTER DATABASE SET already allowed addition of settings for all users in a single database. postgresql.conf has a similar effect. Add support for ALTER RULE ... RENAME (Ali Dar) <link linkend="rules-views"><command>VIEWs</></link> Add a materialized view relations (Kevin Grittner) Unlike ordinary views, where the base tables are read on every access, materialized views create physical tables at creation or refresh time. Access to the materialized view reads from these materialized physical tables. There is no facility for incrementally refreshing materialized views or auto-accessing them via base table access. Make simple views auto-updatable (Dean Rasheed) Simple views that reference some or all columns from a single base table are now updatable by default. More complex views can be made updatable using INSTEAD OF triggers or INSTEAD rules. Allow views and rules to handle cases where referenced tables are renamed, or columns are renamed, added, or dropped (Tom Lane) HOW DOES IT HANDLE A DROPPED REFERENCED COLUMN? Add CREATE RECURSIVE VIEW syntax (Peter Eisentraut) Internally this is translated into CREATE VIEW ... WITH RECURSIVE. When converting a table to a view, remove its system columns (Tom Lane) KEEP? Data Types Increase the maximum length of large objects from 2GB to 4TB (Nozomi Anzai, Yugo Nagata) This change includes new libpq and server-side 64-bit-enabled functions. Allow text timezone designations, e.g. "America/Chicago" when using the ISO "T" timestamptz format (Bruce Momjian) JSON Add operators and functions to extract values from JSON data strings (Andrew Dunstan) Allow JSON data strings to be converted into records (Andrew Dunstan) Add functions to convert values, records, and hstore data to JSON (Andrew Dunstan) Functions Add array_remove() and array_replace() functions (Marco Nenciarini, Gabriele Bartolini) Allow concat() and format() to properly expand VARIADIC-labeled arguments (Pavel Stehule) Improve format() to handle field width and left/right alignment (Pavel Stehule) Have to_char(), to_date(), and to_timestamp() properly handle negative century designations (CC) (Bruce Momjian) Previously the behavior was either wrong or inconsistent with positive/AD handling, e.g. format mask 'IYYY-IW-DY'. Have to_date() and to_timestamp() return proper results when mixing ISO and Gregorian week/day designations (Bruce Momjian) Cause pg_get_viewdef() to default to wrapping after every SELECT target list and FROM entry (Marko Tiikkaja) This causes view output, like from pg_dump, to be more narrow. Have map_sql_value_to_xml_value() properly expand domains (Pavel Stehule) Force cached functions to be replanned if the search_path changes (Tom Lane) Previously functions already run in the current session ignored search_path changes. (Bruce Momjian) Server-Side Languages Allow SPI functions to access the number of rows processed by COPY (Pavel Stehule) <link linkend="plpgsql">PL/pgSQL</link> Server-Side Language Allow PL/pgSQL to use RETURN with a composite-type expressions (Asif Rehman) Previously RETURN could only reference composite-type variables. Allow PL/pgSQL to access the number of rows processed by COPY (Pavel Stehule) The command is GET DIAGNOSTICS x = ROW_COUNT. Allow greater flexibility in where keywords can be used in PL/pgSQL (Tom Lane) <link linkend="plpython">PL/Python</link> Server-Side Language Add PL/Python result object string handler (Peter Eisentraut) This allows plpy.debug(rv) to output something reasonable. Have PL/Python convert oid values to a proper Python numeric type (Peter Eisentraut) Handle SPIErrors raised explicitly with PL/Python's RAISE the same as as internal SPI errors (Oskari Saarenmaa and Jan Urbanski) Client Applications Add command-line utility pg_isready to check if the server is ready to accept connections (Phil Sorber) Support multiple --table arguments for pg_restore, clusterdb, reindexdb, and vacuumdb (Josh Kupershmidt) This is similar to the pg_dump --table support. Add -d option to pg_dumpall, pg_basebackup, pg_receivexlog to specify the connection string (Amit Kapila) Allow pg_ctl --idempotent to a 'success' return code if the requested start/stop action fails, but the cluster is already in the requested state (Peter Eisentraut) Change pg_ctl to return an error code if start fails because the server is already running (Peter Eisentraut) Add libpq function PQconninfo() to return connection information (Zoltán Böszörményi, Magnus Hagander) <link linkend="APP-PSQL"><application>psql</></link> Adjust function cost settings so psql tab completion and pattern searching is more efficient (Tom Lane) Improve psql tab completion (Jeff Janes, Peter Eisentraut) Allow the psql --single-transaction mode to work when reading from standard input (Fabien Coelho, Robert Haas) Previously this option only worked when reading from a file. Remove psql warning when connecting to an older server (Peter Eisentraut) The warning when connecting to a newer server was retained. Backslash Commands Add psql \watch command to repeatedly execute commands (Will Leinweber) Add psql command \gset to store query results in psql variables (Pavel Stehule) Add SSL information to psql's \conninfo command (Alastair Turner) Add "Security" label to psql \df+ output (Jon Erdman) Allow psql \l to accept a database name pattern (Peter Eisentraut) In psql, do not allow \connect to use defaults if there is no active connection (Bruce Momjian) This might be the case if the server had crashed. Properly reset state if psql's "\g file" command failed (Tom Lane) Previously failed commands discarded output from subsequent commands. Output Add a 'latex-longtable' output format to psql (Bruce Momjian) Longtable allows tables to span multiple pages. Add a border=3 output mode to the psql 'latex' format (Bruce Momjian) In psql tuples-only and expanded modes, no longer output "(No rows)" (Peter Eisentraut) In psql, no longer print an empty line for unaligned, expanded output for zero rows (Peter Eisentraut) <link linkend="APP-PGDUMP"><application>pg_dump</></link> Add pg_dump --jobs to dump in parallel when using directory output format (Joachim Wieland) Have pg_dump output functions in a predictable order (Joel Jacobson) Fix tar files emitted by pg_dump and pg_basebackup to be POSIX conformant (Brian Weaver, Tom Lane) Add -d/--dbname option to pg_dump, for consistency with other client commands (Heikki Linnakangas) The database name could already be supplied last without a flag. <link linkend="APP-INITDB"><application>initdb</></link> Have initdb fsync the newly created data directory (Jeff Davis) This can be disabled by using --nosync. Add initdb --sync-only option to sync the data directory to durable storage (Bruce Momjian) This is used by pg_upgrade. Have initdb issue a warning about placing the data directory at the top of file system mount points (Bruce Momjian) Source Code Add an embedded list interface (Andres Freund) Add infrastructure to better support plug-in background worker processes (Álvaro Herrera) Create a centralized timeout API (Zoltán Böszörményi) Create libpgcommon and move pg_malloc() and other functions there (Álvaro Herrera, Andres Freund) This allows libpgport to be used solely for porting code. Standardize on naming of client-side memory allocation functions (Tom Lane) Add compiler designations to indicate some ereport() and elog() calls do not return (Peter Eisentraut, Andres Freund, Tom Lane, Heikki Linnakangas) Allow options to be passed to the regression test output comparison utility via PG_REGRESS_DIFF_OPTS (Peter Eisentraut) Add isolation tests for CREATE INDEX CONCURRENTLY (Abhijit Menon-Sen) Remove typedefs for int2/int4 as they are better represented as int16/int32 (Peter Eisentraut) Fix install-strip on Mac OS X (Peter Eisentraut) Remove configure flag --disable-shared, as it is no longer used (Bruce Momjian) Rewrite pgindent in Perl (Andrew Dunstan) Add emacs macro to match Postgres perltidy formatting (Peter Eisentraut) Run tool to check the keyword list when the backend grammar is changed (Tom Lane) Centralize flex and bison 'make' rules (Peter Eisentraut) This is useful for pgxs authors. Add Assert() functionality to client-side code for frontend code (Andrew Dunstan) Change many internal many backend functions to return OIDs rather than void (Dimitri Fontaine) This is useful for event triggers. Invent pre-commit/pre-prepare/pre-subcommit events for transaction callbacks (Tom Lane) Loadable modules that use transaction callbacks might need modification to handle these new event types. Add function pg_identify_object() to dump an object in machine-readable format (Álvaro Herrera) Add post-ALTER-object server hooks (KaiGai Kohei) Implement a generic binary heap and use it for Merge-Append operations (Abhijit Menon-Sen) Improve ability to detect official timezone abbreviation changes (Tom Lane) Add pkg-config support libpq and ecpg libraries (Peter Eisentraut) Remove src/tool/backend, now that the content is on the Postgres wiki (Bruce Momjian) Split out WAL reading as an independent facility (Heikki Linnakangas, Andres Freund) Use a 64-bit integer to represent WAL positions (XLogRecPtr) instead of two 32-bit integers (Heikki Linnakangas) Generally, tools that need to read the WAL format will need to be adjusted. Allow PL/Python to support platform-specific include directories (Peter Eisentraut) Allow PL/Python on OS X to build against custom versions of Python (Peter Eisentraut) Additional Modules Add a Postgres foreign data wrapper contrib module (Shigeru Hanada, KaiGai Kohei) This foreign data wrapper allows writes; potentially other foreign data wrappers can now support writes. Add pg_xlogdump contrib program (Andres Freund) Add support for indexing of regular-expression searches in contrib/pg_trgm (Alexander Korotkov) Improve pg_trgm handling of multibyte characters (Tom Lane) Add function to report the size of the GIN pending index insertion list (Fujii Masao) The function is pgstatginindex() in pgstattuple. Have oid2name, pgbench, and vacuumlo set fallback_application_name (Amit Kapila) Improve output of pg_test_timing (Bruce Momjian) Improve output of pg_test_fsync (Peter Geoghegan) Improve dblink option validator (Tom Lane) Details? <link linkend="pgupgrade"><application>pg_upgrade</></link> Allow pg_upgrade --jobs to do parallelism (Bruce Momjian) This allows parallel schema dump/restore of databases, as well as parallel copy/link of data files per tablespace. Have pg_upgrade create unix-domain sockets in the current directory (Bruce Momjian, Tom Lane) This reduces the possibility that someone will accidentally connect during the upgrade. Have pg_upgrade --check mode properly detect the location of non-default socket directories (Bruce Momjian, Tom Lane) Improve performance of pg_upgrade for databases with many tables (Bruce Momjian) Increase pg_upgrade logging content by showing executed command (Álvaro Herrera) Improve pg_upgrade's status display during copy/link (Bruce Momjian) <link linkend="pgbench"><application>pgbench</></link> Add --foreign-keys option to pgbench (Jeff Janes) This adds foreign key constraints to tables, for use in foreign key performance testing. Allow pgbench to aggregate performance statistics and produce output every --aggregate-interval specified seconds (Tomas Vondra) Add pg_bench --sampling-rate option to control the percentage of transactions logged (Tomas Vondra) Reduce and improve the status message output of pgbench's initialization mode (Robert Haas, Peter Eisentraut) Add pgbench -q mode to print one output line every five seconds (Tomas Vondra) Output pgbench elapsed and estimated remaining time during initialization logging (Tomas Vondra) Allow pgbench to use a larger scale factor (Greg Smith) Documentation Allow EPUB-format documentation to be created (Peter Eisentraut) Update FreeBSD kernel configuration documentation (Brad Davis) Improve WINDOW function documentation (Bruce Momjian, Tom Lane) Add instructions for setting up the documentation tool chain on Mac OS X (Peter Eisentraut) Improve commit_delay documentation (Peter Geoghegan)