Skip to content
Snippets Groups Projects
release-9.2.sgml 299 KiB
Newer Older
        Remove the <varname>silent_mode</> parameter (Heikki Linnakangas)
        Similar behavior can be obtained with <command>pg_ctl start
        -l postmaster.log</>.
        Remove the <varname>wal_sender_delay</> parameter,
        as it is no longer needed (Tom Lane)
      <listitem>
       <para>
        Remove the <varname>custom_variable_classes</> parameter (Tom Lane)
        The checking provided by this setting was dubious.  Now any
        setting can be prefixed by any class name.
       </para>
      </listitem>
    </itemizedlist>
   </sect3>

   <sect3>
    <title>Monitoring</title>

    <itemizedlist>

      <listitem>
       <para>
        Rename <link
        linkend="monitoring-stats-views-table"><structname>pg_stat_activity</></link><structfield>.procpid</>
        to <structfield>pid</>, to match other system tables (Magnus Hagander)
        Create a separate <structfield>pg_stat_activity</> column to
        report process state (Scott Mead, Magnus Hagander)
        The previous <structfield>query</> and <structfield>query_start</>
        values now remain available for an idle session, allowing enhanced
        analysis.
        Rename <structname>pg_stat_activity</>.<structfield>current_query</> to
        <structfield>query</> because it is not cleared when the query
        completes (Magnus Hagander)
      <listitem>
       <para>
        Change all <acronym>SQL</acronym>-level statistics timing values
        to be <type>float8</> columns measured in milliseconds (Tom Lane)
        This change eliminates the designed-in assumption that the values
        are accurate to microseconds and no more (since the <type>float8</>
        values can be fractional).
        The columns affected are
        <structname>pg_stat_user_functions</>.<structfield>total_time</>,
        <structname>pg_stat_user_functions</>.<structfield>self_time</>,
        <structname>pg_stat_xact_user_functions</>.<structfield>total_time</>,
        and
        <structname>pg_stat_xact_user_functions</>.<structfield>self_time</>.
        The statistics functions underlying these columns now also return
        <type>float8</> milliseconds, rather than <type>bigint</>
        microseconds.
        <filename>contrib/pg_stat_statements</>'
        <structfield>total_time</> column is now also measured in
        milliseconds.
    </itemizedlist>

   </sect3>

  </sect2>

  <sect2>
   <title>Changes</title>

   <para>
    Below you will find a detailed account of the changes between
    <productname>PostgreSQL</productname> 9.2 and the previous major
    release.
   </para>

   <sect3>
    <title>Server</title>

    <sect4>
     <title>Performance</title>

     <itemizedlist>
      <listitem>
       <para>
        Allow queries to retrieve data only from indexes, avoiding heap
        access (Robert Haas, Ibrar Ahmed, Heikki Linnakangas, Tom Lane)
        This feature is often called <firstterm>index-only scans</>.
        Heap access can be skipped for heap pages containing only tuples that
        are visible to all sessions, as reported by the visibility map; so
        the benefit applies mainly to mostly-static data.  The visibility map
        was made crash-safe as a necessary part of implementing this feature.
        Add the <link linkend="SPGiST">SP-GiST</link> (Space-Partitioned
        GiST) index access method (Teodor Sigaev, Oleg Bartunov, Tom
        Lane)
       </para>

       <para>
        SP-GiST is comparable to GiST in flexibility, but supports
        unbalanced partitioned search structures rather than balanced
        trees.  For suitable problems, SP-GiST can be faster than GiST in both
        index build time and search time.
        Allow group commit to work effectively under heavy load (Peter
        Geoghegan, Simon Riggs, Heikki Linnakangas)
       </para>

       <para>
        Previously, batching of commits became ineffective as the write
        workload increased, because of internal lock contention.
        Allow uncontended locks to be managed using a new
        fast-path lock mechanism (Robert Haas)
        Reduce overhead of creating virtual transaction ID locks (Robert
        Reduce the overhead of serializable isolation level locks (Dan
        Ports)
        Improve PowerPC and Itanium spinlock performance (Manabu Ori,
        Robert Haas, Tom Lane)
        Reduce overhead for shared invalidation cache messages (Robert
        Haas)
        Move the frequently accessed members of the <structname>PGPROC</>
        shared memory array to a separate array (Pavan
        Deolasee, Heikki Linnakangas, Robert Haas)
        Improve <command>COPY</command> performance by adding tuples to
        the heap in batches (Heikki Linnakangas)
        Improve GiST index performance for geometric data types by producing
        better trees with less memory allocation overhead (Alexander Korotkov)
        Improve GiST index build times (Alexander Korotkov, Heikki
        Linnakangas)
        Allow hint bits to be set sooner for temporary and unlogged tables
        Allow sorting to be performed by inlined,
        non-<acronym>SQL</acronym>-callable comparison functions (Peter
        Geoghegan, Robert Haas, Tom Lane)
        Make the number of CLOG buffers scale based on <link
        linkend="guc-shared-buffers"><varname>shared_buffers</></link>
        (Robert Haas, Simon Riggs, Tom Lane)
        Improve performance of buffer pool scans that occur when tables or
        databases are dropped (Jeff Janes, Simon Riggs)
        Improve performance of checkpointer's fsync-request queue
        when many tables are being dropped or truncated (Tom Lane)
        Pass the safe number of file descriptors to child processes on Windows
        (Heikki Linnakangas)
        This allows Windows sessions to use more open file descriptors than
        before.
     </itemizedlist>

    </sect4>

    <sect4>
     <title>Process Management</title>

     <itemizedlist>

      <listitem>
       <para>
        Create a dedicated background process to perform checkpoints (Simon
        Formerly the background writer did both dirty-page writing and
        checkpointing.  Separating this into two processes allows each goal
        to be accomplished more predictably.
        Improve asynchronous commit behavior by waking the walwriter sooner
        (Simon Riggs)
       <para>
        Previously, only <link
        linkend="guc-wal-writer-delay"><varname>wal_writer_delay</></link>
        triggered <acronym>WAL</acronym> flushing to disk; now filling a
        <acronym>WAL</acronym> buffer also triggers <acronym>WAL</acronym>
        writes.
       </para>
      </listitem>
        Allow the bgwriter, walwriter, checkpointer, statistics collector,
        log collector, and archiver background processes to sleep more
        efficiently during periods of inactivity (Peter Geoghegan, Tom Lane)
        This series of changes reduces the frequency of process wake-ups when
        there is nothing to do, dramatically reducing power consumption on
        idle servers.
     </itemizedlist>

    </sect4>

    <sect4>
     <title>Optimizer</title>

     <itemizedlist>

      <listitem>
       <para>
        Allow the planner to generate custom plans for specific parameter
        values even when using prepared statements
        In the past, a prepared statement always had a single
        <quote>generic</> plan that was used for all parameter values, which
        was frequently much inferior to the plans used for non-prepared
        statements containing explicit constant values.  Now, the planner
        attempts to generate custom plans for specific parameter values.
        A generic plan will only be used after custom plans have repeatedly
        proven to provide no benefit.  This change should eliminate the
        performance penalties formerly seen from use of prepared statements
        (including non-dynamic statements in PL/pgSQL).
        Improve the planner's ability to use nested loops with inner
        index scans (Tom Lane)
        The new <quote>parameterized path</> mechanism allows inner
        index scans to use values from relations that are more than one join
        level up from the scan.  This can greatly improve performance in
        situations where semantic restrictions (such as outer joins) limit
        the allowed join orderings.
        Improve the planning <acronym>API</acronym> for foreign data wrappers
        (Etsuro Fujita, Shigeru Hanada, Tom Lane)
        Wrappers can now provide multiple access <quote>paths</> for their
        tables, allowing more flexibility in join planning.
        Recognize self-contradictory restriction clauses for non-table
        relations (Tom Lane)
       </para>

       <para>
        This check is only performed when <link
        linkend="guc-constraint-exclusion"><varname>constraint_exclusion</></link>
        is <literal>on</literal>.
        Allow <literal>indexed_col op ANY(ARRAY[...])</> conditions to be
        used in plain index scans and index-only scans (Tom Lane)
       </para>

       <para>
        Formerly such conditions could only be used in bitmap index scans.
      <listitem>
       <para>
        Support <function>MIN</>/<function>MAX</> index optimizations on
        <type>boolean</type> columns (Marti Raudsepp)
      <listitem>
       <para>
        Account for set-returning functions in <command>SELECT</> target
        lists when setting row count estimates (Tom Lane)
        Fix planner to handle indexes with duplicated columns more reliably
        (Tom Lane)
        Collect and use element-frequency statistics for arrays (Alexander
        Korotkov, Tom Lane)
       </para>

       <para>
        This change improves selectivity estimation for the array
        <literal>&lt;@</literal>, <literal>&amp;&amp;</literal>, and
        <literal>@&gt;</literal> operators (array containment and overlaps).
        Allow statistics to be collected for foreign tables
        (Etsuro Fujita)
        Improve cost estimates for use of partial indexes (Tom Lane)
        Improve the planner's ability to use statistics for columns
        referenced in subqueries (Tom Lane)
        Improve statistical estimates for subqueries using
        <literal>DISTINCT</> (Tom Lane)
     </itemizedlist>

    </sect4>

    <sect4>
     <title>Authentication</title>

     <itemizedlist>

      <listitem>
       <para>
        Do not treat role names and <literal>samerole</> specified in <link
        linkend="auth-pg-hba-conf"><filename>pg_hba.conf</filename></link>
        as automatically including superusers (Andrew Dunstan)
        This makes it easier to use <literal>reject</> lines with group roles.
        Adjust <filename>pg_hba.conf</filename> processing to handle token
        parsing more consistently (Brendan Jurd, &Aacute;lvaro Herrera)
        Disallow empty <filename>pg_hba.conf</filename> files (Tom Lane)
        This was done to more quickly detect misconfiguration.
        Make superuser privilege imply replication privilege (Noah Misch)
        This avoids the need to explicitly assign such privileges.
     </itemizedlist>

    </sect4>

    <sect4>
     <title>Monitoring</title>

     <itemizedlist>

      <listitem>
       <para>
        Attempt to log the current query string during a backend crash
        Make logging of autovacuum I/O activity more verbose (Greg
        Smith, Noah Misch)
       <para>
        This logging is triggered by <link
        linkend="guc-log-autovacuum-min-duration"><varname>log_autovacuum_min_duration</></link>.
       </para>
      </listitem>
        Make <acronym>WAL</acronym> replay report failures sooner
       <para>
        There were some cases where failures were only reported once the
        server went into master mode.
       </para>
      </listitem>
      <listitem>
       <para>
        Add <link
        linkend="functions-admin-backup"><function>pg_xlog_location_diff()</></link>
        to simplify WAL location comparisons (Euler Taveira de Oliveira)
       <para>
        This is useful for computing replication lag.
       </para>
      </listitem>
        Support configurable event log application names on Windows
        This allows different instances to use the event log
        with different identifiers, by setting the <link
        linkend="guc-event-source"><varname>event_source</></link>
        server parameter, which is similar to how <link
        linkend="guc-syslog-ident"><varname>syslog_ident</></link> works.
       </para>
      </listitem>
        Change <quote>unexpected EOF</> messages to <literal>DEBUG1</> level,
        except when there is an open transaction (Magnus Hagander)

       <para>
        This change reduces log chatter caused by applications that close
        database connections ungracefully.
       </para>
     </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