http://developer.postgresql.org/pgdocs/postgres/release-8-2.html * FILLFACTOR: When a smaller fillfactor is specified, INSERT operations pack table pages only to the indicated percentage; the remaining space on each page is reserved for updating rows on that page. This gives UPDATE a chance to place the updated copy of a row on the same page as the original, which is more efficient than placing it on a different page. For a table whose entries are never updated, complete packing is the best choice, but in heavily updated tables smaller fillfactors are appropriate. CREATE TABLE ug ( id SERIAL PRIMARY KEY, name TEXT, description TEXT, popularity INTEGER DEFAULT 0 ) WITH (FILLFACTOR = 50); * Allow the planner to reorder outer joins in some circumstances. In previous releases, outer joins would always be evaluated in the order specified by the query. This change means that the query optimizer will consider reordering outer joins in some cases, provided that the join order can be changed without altering the meaning of the query. This can make a considerable performance difference for queries involving multiple outer joins. * Add native LDAP authentication (Magnus Hagander). This is particularly useful for platforms that do not support PAM, such as Win32. * Allow units to be specified in configuration settings (Peter) * Add support for include directives in postgresql.conf (Joachim Wieland) INSERT INTO ug (name, popularity) VALUES ('Portland PostgreSQL Users', 10) RETURNING id; * Add support for multiple-row VALUES clauses as part of INSERT and SELECT statements, per SQL standard (Joe, Tom) INSERT INTO ug (name, popularity) VALUES ('Portland PHP Users', 2), ('PDX.pm', 9), ('Portland Rubyists', 8) RETURNING id; * Allow UPDATE and DELETE to use an alias for the target table (Atsushi Ogawa). This allows these statements to support self-joins more conveniently. * Allow UPDATE to set multiple columns with a list of values (Susanne Ebrecht). This is basically as short-hand for assigning the columns and values in pairs. UPDATE ug SET (name, description) = ('Porland Perl Mongers', 'Le monguers de Portland'), WHERE name = 'PDX.pm' RETURNING id; * Add IS NOT DISTINCT FROM (Pavel Stehule). This operator is similar to equality (=), but evaluates to true when both left and right operands are NULL, and to false when just one is, rather than yielding NULL in these cases. SELECT NULL IS NOT DISTINCT FROM NULL; * Add new aggregate creation syntax (Tom): CREATE FUNCTION mysum(INT, INT) RETURNS INT AS $$ SELECT $1 + ($2 * 2) $$ LANGUAGE 'sql' STRICT; CREATE AGGREGATE mysum ( BASETYPE = INTEGER, STYPE = INTEGER, SFUNC = mysum, INITCOND = 0 ); Becomes: CREATE AGGREGATE mysum ( INTEGER ) ( STYPE = INTEGER, SFUNC = mysum, INITCOND = 0 ); For: SELECT mysum(popularity) FROM ug; * Aggregate functions now support multiple input parameters (Sergey Koposov, Tom) CREATE FUNCTION fatsum(INT, INT, INT) RETURNS INT AS $$ SELECT $1 + $2 + $3 $$ LANGUAGE 'sql' STRICT; CREATE AGGREGATE fatsum ( INTEGER, INTEGER ) ( STYPE = INTEGER, SFUNC = fatsum, INITCOND = 0 ); For: SELECT fatsum(id, popularity) FROM ug; * Add DROP object IF EXISTS for many object types (Andrew). DROP AGGREGATE IF EXISTS mysum(int); * Allow full timezone names in timestamp values (Joachim Wieland) '2006-05-24 21:11 America/New_York'::timestamptz * Allow arrays to contain NULL elements (Tom) SELECT ARRAY[ 1, NULL, 2, 3 ]; * New operators for array-subset comparisons (@>, <@, &&) (Teodor, Tom). SELECT ARRAY[ 1, NULL, 2, 3] && ARRAY[1, 2, 12]; -- Overlap SELECT ARRAY[ 1, NULL, 2, 3] @> ARRAY[1, 2 ]; -- A contains B SELECT ARRAY[ 1, 2, 3] <@ ARRAY[1, NULL, 2, 3]; -- B contains A * Allow domains to be created using other domains (Tom) CREATE DOMAIN state AS SMALLINT NOT NULL DEFAULT 1 CONSTRAINT ck_state CHECK ( VALUE BETWEEN 1 AND 10 ); CREATE DOMAIN substate AS state CONSTRAINT ck_substate CHECK ( VALUE <= 5 ); CREATE TABLE states (state STATE, substate SUBSTATE); INSERT INTO states VALUES (1, 1); INSERT INTO states VALUES (1, -1); * Properly enforce domain CHECK constraints everywhere (Neil, Tom). For example, the result of a user-defined function that is declared to return a domain type is now checked against the constraints. This closes a significant hole in the domain implementation. * Add a server-side sleep function pg_sleep() (Joachim Wieland): SELECT pg_sleep(1); * PL/PgSQL Server-Side Language Changes: + Add STRICT to SELECT INTO (Matt Miller). STRICT mode throws an exception if more or less than one row is returned by the SELECT, for Oracle PL/SQL compatibility. + Add a BY clause to the FOR loop, to control the iteration increment (Jaime Casanova): CREATE OR REPLACE FUNCTION testby () returns SETOF INTEGER as $$ BEGIN FOR i IN REVERSE 10..1 BY 2 LOOP RETURN NEXT i; END LOOP; END; $$ LANGUAGE 'plpgsql' STRICT; SELECT * FROM testby(); * Add prepared queries to PL/Perl (Dmitry Karasik) * Allow returning of composite types and result sets to PL/Python (Sven Suursoho) * Add named parameters to the args[] array in PL/Python (Sven Suursoho) * psql: + Add option psql to run the entire session in a single transaction (Simon). Use options -1 or --single-transaction. + Support for automatically retrieving SELECT results in batches using a cursor (Chris Mair). This is accomplished using \set FETCH_COUNT. This feature allows large result sets to be manipulated in psql without needing to buffer the entire result set in memory. \set FETCH_COUNT = 3 SELECT * FROM ug; \set FETCH_COUNT + Allow multi-line values to align in the proper column (Martijn van Oosterhout) UPDATE ug SET description = 'This is a multiline value for the description' WHERE id = 4; SELECT * FROM ug; + Save multi-line statements as a single entry, rather than one line at a time (Sergey E. Koposov) * Add --with-libedit-preferred configure flag to allow libedit to be preferred over GNU readline (Bruce) http://developer.postgresql.org/pgdocs/postgres/release-8-2.html