Skip to content
Snippets Groups Projects
release-9.2.sgml 310 KiB
Newer Older
     </itemizedlist>

    </sect4>

    <sect4>
     <title>Statistical Views</title>

     <itemizedlist>

      <listitem>
       <para>
        Track temporary file sizes and file counts in the <link
        linkend="pg-stat-database-view"><structname>pg_stat_database</></link>
        system view (Tomas Vondra)
       </para>
      </listitem>
      <listitem>
       <para>
        Add a deadlock counter to the <structname>pg_stat_database</>
        system view (Magnus Hagander)
        Add a server parameter <link
        linkend="guc-track-io-timing"><varname>track_io_timing</></link>
        to track I/O timings (Ants Aasma, Robert Haas)
      <listitem>
       <para>
        Report checkpoint timing information in <link
        linkend="pg-stat-bgwriter-view"><structname>pg_stat_bgwriter</></link>
        (Greg Smith, Peter Geoghegan)
     </itemizedlist>

    </sect4>

    <sect4>
     <title>Server Settings</title>

     <itemizedlist>

      <listitem>
       <para>
        Silently ignore nonexistent schemas specified in <link
        linkend="guc-search-path"><varname>search_path</></link> (Tom Lane)
       </para>

       <para>
        This makes it more convenient to use generic path settings, which
        might include some schemas that don't exist in all databases.
       </para>
      </listitem>

      <listitem>
       <para>
        Allow superusers to set <link
        linkend="guc-deadlock-timeout"><varname>deadlock_timeout</></link>
        per-session, not just per-cluster (Noah Misch)
       <para>
        This allows <varname>deadlock_timeout</> to be reduced for
        transactions that are likely to be involved in a deadlock, thus
        detecting the failure more quickly.  Alternatively, increasing the
        value can be used to reduce the chances of a session being chosen for
        cancellation due to a deadlock.
        Add a server parameter <link
        linkend="guc-temp-file-limit"><varname>temp_file_limit</></link>
        to constrain temporary file space usage per session (Mark Kirkwood)
        Allow a superuser to <command>SET</command> an extension's
        superuser-only custom variable before loading the associated
        extension (Tom Lane)
       </para>
       <para>
        The system now remembers whether a <command>SET</command> was
        performed by a superuser, so that proper privilege checking can be
        done when the extension is loaded.
      <listitem>
       <para>
        Add <link linkend="app-postmaster">postmaster</link> <option>-C</>
        option to query configuration parameters (Bruce Momjian)
       </para>
        This allows <application>pg_ctl</> to better handle cases where
        <envar>PGDATA</> or <option>-D</> points to a configuration-only
        directory.
        Replace an empty locale name with the implied value in
        <command>CREATE DATABASE</>
        (Tom Lane)
       </para>

       <para>
        This prevents cases where
        <structname>pg_database</>.<structfield>datcollate</> or
        <structfield>datctype</> could be interpreted differently after a
        server restart.
     </itemizedlist>

     <sect5>
      <title><filename>postgresql.conf</filename></title>

      <itemizedlist>

      <listitem>
       <para>
        Allow multiple errors in <filename>postgresql.conf</filename>
        to be reported, rather than just the first one (Alexey Klyukin,
      <listitem>
       <para>
        Allow a reload of <filename>postgresql.conf</filename> to be
        processed by all sessions, even if there are some settings that
        are invalid for particular sessions (Alexey Klyukin)
        Previously, such not-valid-within-session values would cause all
        setting changes to be ignored by that session.
      <listitem>
       <para>
        Add an <literal>include_if_exists</> facility for configuration
       <para>
        This works the same as <literal>include</>, except that an error
        is not thrown if the file is missing.
       </para>
      </listitem>
        Identify the server time zone during <application>initdb</>, and set
        <filename>postgresql.conf</filename> entries
        <link linkend="guc-timezone"><varname>timezone</></link> and
        <link linkend="guc-log-timezone"><varname>log_timezone</></link>
        accordingly (Tom Lane)
       </para>
       <para>
        This avoids expensive time zone probes during server start.
       </para>
      </listitem>
        Fix <link
        linkend="view-pg-settings"><structname>pg_settings</></link> to
        report <filename>postgresql.conf</filename> line numbers on Windows
    </sect4>

   </sect3>

   <sect3>
    <title>Replication and Recovery</title>

        Allow streaming replication slaves to forward data to other slaves
        (<link linkend="cascading-replication"><firstterm>cascading
        replication</></link>) (Fujii Masao)
       <para>
        Previously, only the master server could supply streaming
        replication log files to standby servers.
      <listitem>
       <para>
        Add new <link
        linkend="guc-synchronous-commit"><varname>synchronous_commit</></link>
        mode <literal>remote_write</> (Fujii Masao, Simon Riggs)
        This mode waits for the standby server to write transaction data to
        its own operating system, but does not wait for the data to be
        flushed to the standby's disk.
      <listitem>
       <para>
        Add a <link
        linkend="app-pgreceivexlog"><application>pg_receivexlog</></link>
        tool to archive WAL file changes as they are written, rather
        than waiting for completed WAL files (Magnus Hagander)
        Allow <link
        linkend="app-pgbasebackup"><application>pg_basebackup</></link>
        to make base backups from standby servers (Jun Ishizuka, Fujii Masao)
        This feature lets the work of making new base backups be off-loaded
        from the primary server.
        Allow streaming of WAL files while <application>pg_basebackup</>
        is performing a backup (Magnus Hagander)
       </para>

       <para>
        This allows passing of WAL files to the standby before they are
        discarded on the primary.

   </sect3>

   <sect3>
    <title>Queries</title>

     <itemizedlist>

      <listitem>
       <para>
        Cancel the running query if the client gets disconnected
        (Florian Pflug)
       </para>

       <para>
        If the backend detects loss of client connection during a query, it
        will now cancel the query rather than attempting to finish it.
        Retain column names at run time for row expressions
        (Andrew Dunstan, Tom Lane)
        This change allows better results when a row value is converted to
        <type>hstore</> or <type>json</> type: the fields of the resulting
        value will now have the expected names.
        Improve column labels used for sub-<command>SELECT</> results
        (Marti Raudsepp)
       </para>

       <para>
        Previously, the generic label <literal>?column?</> was used.
        Improve heuristics for determining the types of unknown values
        (Tom Lane)
       </para>

       <para>
        The longstanding rule that an unknown constant might have the
        same type as the value on the other side of the operator using it
        is now applied when considering polymorphic operators, not only
        for simple operator matches.
        Warn about creating casts to or from domain types (Robert Haas)
        Such casts have no effect.
      <listitem>
       <para>
        When a row fails a <literal>CHECK</> or <literal>NOT NULL</>
        constraint, show the row's contents as error detail (Jan
       <para>
        This should make it easier to identify which row is problematic
        when an insert or update is processing many rows.
       </para>
      </listitem>
     </itemizedlist>

   </sect3>

   <sect3>
    <title>Object Manipulation</title>

     <itemizedlist>

      <listitem>
       <para>
        Provide more reliable operation during concurrent
        <acronym>DDL</acronym> (Robert Haas, Noah Misch)
       </para>
        This change adds locking that should eliminate <quote>cache lookup
        failed</> errors in many scenarios.  Also, it is no longer possible
        to add relations to a schema that is being concurrently dropped, a
        scenario that formerly led to inconsistent system catalog contents.
       </para>
      <listitem>
       <para>
        Add <literal>CONCURRENTLY</> option to <link
        linkend="SQL-DROPINDEX"><command>DROP INDEX</command></link>
        (Simon Riggs)
       <para>
        This allows index removal without blocking other sessions.
       </para>
      </listitem>
      <listitem>
       <para>
        Allow foreign data wrappers to have per-column options (Shigeru Hanada)
       </para>
      </listitem>

      <listitem>
       <para>
        Improve pretty-printing of view definitions (Andrew Dunstan)
     </itemizedlist>

    <sect4>
     <title>Constraints</title>

     <itemizedlist>

      <listitem>
       <para>
        Allow <link linkend="ddl-constraints"><literal>CHECK</></link>
        constraints to be declared <literal>NOT VALID</> (&Aacute;lvaro
        Adding a <literal>NOT VALID</> constraint does not cause the table to
        be scanned to verify that existing rows meet the constraint.
        Subsequently, newly added or updated rows are checked.
        Such constraints are ignored by the planner when considering
        <varname>constraint_exclusion</>, since it is not certain that all
        rows meet the constraint.
        The new <command>ALTER TABLE VALIDATE</> command allows <literal>NOT
        VALID</> constraints to be checked for existing rows, after which
        they are converted into ordinary constraints.
      <listitem>
       <para>
        Allow <literal>CHECK</> constraints to be declared <literal>NO
        INHERIT</> (Nikhil Sontakke, Alex Hunsaker, &Aacute;lvaro Herrera)
       <para>
        This makes them enforceable only on the parent table, not on
        child tables.
       </para>
      </listitem>
      <listitem>
       <para>
        Add the ability to <link linkend="SQL-ALTERTABLE">rename</link>
        constraints (Peter Eisentraut)
       </para>
      </listitem>
     </itemizedlist>

    </sect4>

    <sect4>
     <title><command>ALTER</></title>

     <itemizedlist>

      <listitem>
       <para>
        Reduce need to rebuild tables and indexes for certain <link
        linkend="SQL-ALTERTABLE"><command>ALTER TABLE</command></link>
        ... <literal>ALTER COLUMN TYPE</> operations (Noah Misch)
        Increasing the length limit for a <type>varchar</> or <type>varbit</>
        column, or removing the limit altogether, no longer requires a table
        rewrite.  Similarly, increasing the allowable precision of a
        <type>numeric</> column, or changing a column from constrained
        <type>numeric</> to unconstrained <type>numeric</>, no longer
        requires a table rewrite.  Table rewrites are also avoided in similar
        cases involving the <type>interval</>, <type>timestamp</>, and
        <type>timestamptz</> types.
        Avoid having <link linkend="SQL-ALTERTABLE"><command>ALTER
        TABLE</command></link> revalidate foreign key constraints in some
        cases where it is not necessary (Noah Misch)
       </para>
      </listitem>

      <listitem>
       <para>
        Add <literal>IF EXISTS</> options to some <command>ALTER</command>
        commands (Pavel Stehule)
       </para>
       <para>
        For example, <command>ALTER FOREIGN TABLE IF EXISTS foo RENAME
        TO bar</command>.
       </para>
      </listitem>
      <listitem>
       <para>
        Add <link linkend="SQL-ALTERFOREIGNDATAWRAPPER"><command>ALTER
        FOREIGN DATA WRAPPER</command></link> ... <literal>RENAME</>
        and <link linkend="SQL-ALTERSERVER"><command>ALTER
        SERVER</command></link> ... <literal>RENAME</> (Peter Eisentraut)
      <listitem>
       <para>
        Add <link linkend="SQL-ALTERDOMAIN"><command>ALTER
        DOMAIN</command></link> ... <literal>RENAME</> (Peter Eisentraut)
       <para>
        You could already rename domains using <command>ALTER
        TYPE</command>.
       </para>
      </listitem>
        Throw an error for <command>ALTER DOMAIN</command> ... <literal>DROP
        CONSTRAINT</> on a nonexistent constraint (Peter Eisentraut)
       </para>
        An <literal>IF EXISTS</> option has been added to provide the
        previous behavior.
       </para>
      </listitem>
     <title><link linkend="SQL-CREATETABLE"><command>CREATE TABLE</></link></title>
        Allow <command>CREATE TABLE (LIKE ...)</command> from foreign
        tables, views, and composite types (Peter Eisentraut)
        For example, this allows a table to be created whose schema matches a
        view.
        Fix <command>CREATE TABLE (LIKE ...)</command> to avoid index name
        conflicts when copying index comments (Tom Lane)
        Fix <command>CREATE TABLE</command> ... <literal>AS EXECUTE</>
        to handle <literal>WITH NO DATA</> and column name specifications
        (Tom Lane)
     </itemizedlist>

    </sect4>

    <sect4>
     <title>Object Permissions</title>

     <itemizedlist>

      <listitem>
       <para>
        Add a <link
        linkend="SQL-CREATEVIEW"><literal>security_barrier</></link>
        option for views (KaiGai Kohei, Robert Haas)
        This option prevents optimizations that might allow view-protected
        data to be exposed to users, for example pushing a clause involving
        an insecure function into the <literal>WHERE</> clause of the view.
        Such views can be expected to perform more poorly than ordinary
        views.
      <listitem>
       <para>
        Add a new <link
        linkend="SQL-CREATEFUNCTION"><literal>LEAKPROOF</></link> function
        attribute to mark functions that can safely be pushed down
        into <literal>security_barrier</> views (KaiGai Kohei)
       </para>
      </listitem>
        Add support for privileges on data types (Peter Eisentraut)
       <para>
        This adds support for the <acronym>SQL</>-conforming
        <literal>USAGE</> privilege on types and domains.  The intent is
        to be able to restrict which users can create dependencies on types,
        since such dependencies limit the owner's ability to alter the type.
      <listitem>
       <para>
        Check for <command>INSERT</command> privileges in <command>SELECT
        INTO</command> / <command>CREATE TABLE AS</command> (KaiGai Kohei)
        Because the object is being created by <command>SELECT INTO</command>
        or <command>CREATE TABLE AS</command>, the creator would ordinarily
        have insert permissions; but there are corner cases where this is not
        true, such as when <literal>ALTER DEFAULT PRIVILEGES</> has removed
        such permissions.

     </itemizedlist>

    </sect4>

   </sect3>

   <sect3>
    <title>Utility Operations</title>

    <itemizedlist>

      <listitem>
       <para>
        Allow <link linkend="SQL-VACUUM"><command>VACUUM</></link> to more
        easily skip pages that cannot be locked (Simon Riggs, Robert Haas)
        This change should greatly reduce the incidence of <command>VACUUM</>
        getting <quote>stuck</> waiting for other sessions.
        Make <link linkend="SQL-EXPLAIN"><command>EXPLAIN</></link>
        <literal>(BUFFERS)</> count blocks dirtied and written (Robert Haas)
        Make <command>EXPLAIN ANALYZE</command> report the number of rows
        rejected by filter steps (Marko Tiikkaja)
        Allow <command>EXPLAIN ANALYZE</command> to avoid timing overhead when
        time values are not wanted (Tomas Vondra)
        This is accomplished by setting the new <literal>TIMING</> option to
        <literal>FALSE</>.
       </para>
      </listitem>

   </sect3>

   <sect3>
    <title>Data Types</title>

    <itemizedlist>

      <listitem>
       <para>
        Add support for <link linkend="rangetypes">range data types</link>
        (Jeff Davis, Tom Lane, Alexander Korotkov)
        A range data type stores a lower and upper bound belonging to its
        base data type.  It supports operations like contains, overlaps, and
        intersection.
        Add a <link linkend="datatype-json"><type>JSON</type></link>
        data type (Robert Haas)
        This type stores <acronym>JSON</acronym> (JavaScript Object Notation)
        data with proper validation.
        Add <link
        linkend="functions-json"><function>array_to_json()</></link>
        and <function>row_to_json()</> (Andrew Dunstan)
        Add a <link linkend="datatype-serial"><type>SMALLSERIAL</></link>
       <para>
        This is like <type>SERIAL</>, except it stores the sequence in
        a two-byte integer column (<type>int2</>).
      <listitem>
       <para>
        Allow <link linkend="SQL-CREATEDOMAIN">domains</link> to be
        declared <literal>NOT VALID</> (&Aacute;lvaro Herrera)
        This option can be set at domain creation time, or via <command>ALTER
        DOMAIN</command> ... <literal>ADD CONSTRAINT</> ... <literal>NOT
        VALID</>. <command>ALTER DOMAIN</command> ... <literal>VALIDATE
        CONSTRAINT</> fully validates the constraint.
      <listitem>
       <para>
        Support more locale-specific formatting options for the <link
        linkend="datatype-money"><type>money</></link> data type (Tom Lane)
        Specifically, honor all the POSIX options for ordering of the value,
        sign, and currency symbol in monetary output.  Also, make sure that
        the thousands separator is only inserted to the left of the decimal
        point, as required by POSIX.
        Add bitwise <quote>and</>, <quote>or</>, and <quote>not</>
        operators for the <type>macaddr</> data type (Brendan Jurd)
        Allow <link
        linkend="functions-xml-processing"><function>xpath()</></link> to
        return a single-element <acronym>XML</acronym> array when supplied a
        scalar value (Florian Pflug)
       <para>
        Previously, it returned an empty array.  This change will also
        cause <function>xpath_exists()</> to return true, not false,
        for such expressions.
       </para>

      <listitem>
       <para>
        Improve <acronym>XML</acronym> error handling to be more robust

   </sect3>

   <sect3>
    <title>Functions</title>

     <itemizedlist>

      <listitem>
       <para>
        Allow non-superusers to use <link
        linkend="functions-admin-signal"><function>pg_cancel_backend()</></link>
        linkend="functions-admin-signal"><function>pg_terminate_backend()</></link>
        on other sessions belonging to the same user
        (Magnus Hagander, Josh Kupershmidt, Dan Farina)
        Previously only superusers were allowed to use these functions.
      <listitem>
       <para>
        Allow importing and exporting of transaction snapshots (Joachim
        This allows multiple transactions to share identical views of the
        database state.
        Snapshots are exported via <link
        linkend="functions-snapshot-synchronization"><function>pg_export_snapshot()</></link>
        and imported via <link linkend="SQL-SET-TRANSACTION"><command>SET
        TRANSACTION SNAPSHOT</command></link>.  Only snapshots from
        currently-running transactions can be imported.
      <listitem>
       <para>
        Support <link
        linkend="functions-info-catalog-table"><literal>COLLATION
        FOR</></link> on expressions (Peter Eisentraut)
       <para>
        This returns a string representing the collation of the expression.
       </para>
      </listitem>
        Add <link
        linkend="functions-info-schema-table"><function>pg_opfamily_is_visible()</></link>
        (Josh Kupershmidt)
        Add a <type>numeric</> variant of <link
        linkend="functions-admin-dbsize"><function>pg_size_pretty()</></link>
        for use with <function>pg_xlog_location_diff()</> (Fujii Masao)
      <listitem>
       <para>
        Add a <link
        linkend="functions-info-session-table"><function>pg_trigger_depth()</></link>
        function (Kevin Grittner)
       </para>
       <para>
        This reports the current trigger call depth.
       </para>
      </listitem>
        Allow <link
        linkend="functions-aggregate-table"><function>string_agg()</></link>
        to process <type>bytea</> values (Pavel Stehule)
        Fix regular expressions in which a back-reference occurs within
        a larger quantified subexpression (Tom Lane)
        For example, <literal>^(\w+)( \1)+$</>.  Previous releases did not
        check that the back-reference actually matched the first occurrence.
   <sect3>
    <title><link linkend="information-schema">Information Schema</link></title>
        Add information schema views
        <structname>role_udt_grants</>, <structname>udt_privileges</>,
        and <structname>user_defined_types</> (Peter Eisentraut)
       </para>
      </listitem>

      <listitem>
       <para>
        Add composite-type attributes to the
        information schema <structname>element_types</> view
        (Peter Eisentraut)
       </para>
      </listitem>
        Implement <structfield>interval_type</> columns in the information
        schema (Peter Eisentraut)
        Formerly these columns read as nulls.
        Implement collation-related columns in the information schema
        <structname>attributes</>, <structname>columns</>,
        <structname>domains</>, and <structname>element_types</>
        views (Peter Eisentraut)
        Implement the <structfield>with_hierarchy</> column in the
        information schema <structname>table_privileges</> view (Peter
        Eisentraut)
        Add display of sequence <literal>USAGE</> privileges to information
        schema (Peter Eisentraut)
        Make the information schema show default privileges (Peter
        Previously, non-empty default permissions were not represented in the
        views.
     </itemizedlist>

   </sect3>

   <sect3>
    <title>Server-Side Languages</title>

    <sect4>
     <title><link linkend="plpgsql">PL/pgSQL</link> Server-Side Language</title>

     <itemizedlist>

      <listitem>
       <para>
        Allow the PL/pgSQL <command>OPEN</> cursor command to supply
        parameters by name (Yeb Havinga)
      <listitem>
       <para>
        Add a <command>GET STACKED DIAGNOSTICS</command> PL/pgSQL command
        to retrieve exception info (Pavel Stehule)
      <listitem>
       <para>
        Speed up PL/pgSQL array assignment by caching type information
        (Pavel Stehule)
       </para>
      </listitem>
        Improve performance and memory consumption for long chains of
        <literal>ELSIF</> clauses (Tom Lane)
       </para>
      </listitem>
      <listitem>
       <para>
        Output the function signature, not just the name, in PL/pgSQL
        error messages (Pavel Stehule)