Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
E.57. Release 9.6
Prev UpAppendix E. Release NotesHome Next

E.57. Release 9.6

Release date: 2016-09-29

E.57.1. Overview

Major enhancements inPostgreSQL 9.6 include:

  • Parallel execution of sequential scans, joins and aggregates

  • Avoid scanning pages unnecessarily during vacuum freeze operations

  • Synchronous replication now allows multiple standby servers for increased reliability

  • Full-text search can now search for phrases (multiple adjacent words)

  • postgres_fdw now supports remote joins, sorts,UPDATEs, andDELETEs

  • Substantial performance improvements, especially in the area of scalability on multi-CPU-socket servers

The above items are explained in more detail in the sections below.

A dump/restore usingpg_dumpall, or use ofpg_upgrade, is required for those wishing to migrate data from any previous release.

Version 9.6 contains a number of changes that may affect compatibility with previous releases. Observe the following incompatibilities:

  • Improve thepg_stat_activity view's information about what a process is waiting for (Amit Kapila, Ildus Kurbangaliev)

    Historically a process has only been shown as waiting if it was waiting for a heavyweight lock. Now waits for lightweight locks and buffer pins are also shown inpg_stat_activity. Also, the type of lock being waited for is now visible. These changes replace thewaiting column withwait_event_type andwait_event.

  • Into_char(), do not count a minus sign (when needed) as part of the field width for time-related fields (Bruce Momjian)

    For example,to_char('-4 years'::interval, 'YY') now returns-04, rather than-4.

  • Makeextract() behave more reasonably with infinite inputs (Vitaly Burovoy)

    Historically theextract() function just returned zero given an infinite timestamp, regardless of the given field name. Make it returninfinity or-infinity as appropriate when the requested field is one that is monotonically increasing (e.g,year,epoch), orNULL when it is not (e.g.,day,hour). Also, throw the expected error for bad field names.

  • Remove PL/pgSQL'sfeature that suppressed the innermost line ofCONTEXT for messages emitted byRAISE commands (Pavel Stehule)

    This ancient backwards-compatibility hack was agreed to have outlived its usefulness.

  • Fix the default text search parser to allow leading digits inemail andhost tokens (Artur Zakirov)

    In most cases this will result in few changes in the parsing of text. But if you have data where such addresses occur frequently, it may be worth rebuilding dependenttsvector columns and indexes so that addresses of this form will be found properly by text searches.

  • Extendcontrib/unaccent's standardunaccent.rules file to handle all diacritics known to Unicode, and to expand ligatures correctly (Thomas Munro, Léonard Benedetti)

    The previous version neglected to convert some less-common letters with diacritic marks. Also, ligatures are now expanded into separate letters. Installations that use this rules file may wish to rebuildtsvector columns and indexes that depend on the result.

  • Remove the long-deprecatedCREATEUSER/NOCREATEUSER options fromCREATE ROLE and allied commands (Tom Lane)

    CREATEUSER actually meantSUPERUSER, for ancient backwards-compatibility reasons. This has been a constant source of confusion for people who (reasonably) expect it to meanCREATEROLE. It has been deprecated for ten years now, so fix the problem by removing it.

  • Treat role names beginning withpg_ as reserved (Stephen Frost)

    User creation of such role names is now disallowed. This prevents conflicts with built-in roles created byinitdb.

  • Change a column name in theinformation_schema.routines view fromresult_cast_character_set_name toresult_cast_char_set_name (Clément Prévost)

    The SQL:2011 standard specifies the longer name, but that appears to be a mistake, because adjacent column names use the shorter style, as do otherinformation_schema views.

  • psql's-c option no longer implies--no-psqlrc (Pavel Stehule, Catalin Iacob)

    Write--no-psqlrc (or its abbreviation-X) explicitly to obtain the old behavior. Scripts so modified will still work with old versions ofpsql.

  • Improvepg_restore's-t option to match all types of relations, not only plain tables (Craig Ringer)

  • Change the display format used forNextXID inpg_controldata and related places (Joe Conway, Bruce Momjian)

    Display epoch-and-transaction-ID values in the formatnumber:number. The previous formatnumber/number was confusingly similar to that used forLSNs.

  • Update extension functions to be marked parallel-safe where appropriate (Andreas Karlsson)

    Many of the standard extensions have been updated to allow their functions to be executed within parallel query worker processes. These changes will not take effect in databasespg_upgrade'd from prior versions unless you applyALTER EXTENSION UPDATE to each such extension (in each database of a cluster).

Below you will find a detailed account of the changes betweenPostgreSQL 9.6 and the previous major release.

E.57.3.1.2. Indexes
  • AllowGIN index builds to make effective use ofmaintenance_work_mem settings larger than 1 GB (Robert Abraham, Teodor Sigaev)

  • Add pages deleted from a GIN index's pending list to the free space map immediately (Jeff Janes, Teodor Sigaev)

    This reduces bloat if the table is not vacuumed often.

  • Addgin_clean_pending_list() function to allow manual invocation of pending-list cleanup for a GIN index (Jeff Janes)

    Formerly, such cleanup happened only as a byproduct of vacuuming or analyzing the parent table.

  • Improve handling of dead index tuples inGiST indexes (Anastasia Lubennikova)

    Dead index tuples are now marked as such when an index scan notices that the corresponding heap tuple is dead. When inserting tuples, marked-dead tuples will be removed if needed to make space on the page.

  • Add anSP-GiST operator class for typebox (Alexander Lebedev)

E.57.3.1.3. Sorting
E.57.3.1.8. Monitoring
  • Addpg_stat_progress_vacuum system view to provide progress reporting forVACUUM operations (Amit Langote, Robert Haas, Vinayak Pokale, Rahila Syed)

  • Addpg_control_system(),pg_control_checkpoint(),pg_control_recovery(), andpg_control_init() functions to expose fields ofpg_control toSQL (Joe Conway, Michael Paquier)

  • Addpg_config system view (Joe Conway)

    This view exposes the same information available from thepg_config command-line utility, namely assorted compile-time configuration information forPostgreSQL.

  • Add aconfirmed_flush_lsn column to thepg_replication_slots system view (Marko Tiikkaja)

  • Addpg_stat_wal_receiver system view to provide information about the state of a hot-standby server'sWAL receiver process (Michael Paquier)

  • Addpg_blocking_pids() function to reliably identify which sessions block which others (Tom Lane)

    This function returns an array of the process IDs of any sessions that are blocking the session with the given process ID. Historically users have obtained such information using a self-join on thepg_locks view. However, it is unreasonably tedious to do it that way with any modicum of correctness, and the addition of parallel queries has made the old approach entirely impractical, since locks might be held or awaited by child worker processes rather than the session's main process.

  • Add functionpg_current_xlog_flush_location() to expose the current transaction log flush location (Tomas Vondra)

  • Add functionpg_notification_queue_usage() to report how full theNOTIFY queue is (Brendan Jurd)

  • Limit the verbosity of memory context statistics dumps (Tom Lane)

    The memory usage dump that is output to the postmaster log during an out-of-memory failure now summarizes statistics when there are a large number of memory contexts, rather than possibly generating a very large report. There is also agrand total summary line now.

E.57.3.1.9. Authentication

E.57.3.3. Queries

  • Allow functions that return sets of tuples to return simpleNULLs (Andrew Gierth, Tom Lane)

    In the context ofSELECT FROM function(...), a function that returned a set of composite values was previously not allowed to return a plainNULL value as part of the set. Now that is allowed and interpreted as a row ofNULLs. This avoids corner-case errors with, for example, unnesting an array of composite values.

  • Fully support array subscripts and field selections in the target column list of anINSERT with multipleVALUES rows (Tom Lane)

    Previously, such cases failed if the same target column was mentioned more than once, e.g.,INSERT INTO tab (x[1], x[2]) VALUES (...).

  • When appropriate, postpone evaluation ofSELECT output expressions until after anORDER BY sort (Konstantin Knizhnik)

    This change ensures that volatile or expensive functions in the output list are executed in the order suggested byORDER BY, and that they are not evaluated more times than required when there is aLIMIT clause. Previously, these properties held if the ordering was performed by an index scan or pre-merge-join sort, but not if it was performed by a top-level sort.

  • Widen counters recording the number of tuples processed to 64 bits (Andreas Scherbaum)

    This change allows command tags, e.g.,SELECT, to correctly report tuple counts larger than 4 billion. This also applies to PL/pgSQL'sGET DIAGNOSTICS ... ROW_COUNT command.

  • Avoid doing encoding conversions by converting through theMULE_INTERNAL encoding (Tom Lane)

    Previously, many conversions for Cyrillic and Central European single-byte encodings were done by converting to a relatedMULE_INTERNAL coding scheme and then to the destination encoding. Aside from being inefficient, this meant that when the conversion encountered an untranslatable character, the error message would confusingly complain about failure to convert to or fromMULE_INTERNAL, rather than the user-visible encoding.

  • Consider performing joins of foreign tables remotely only when the tables will be accessed under the same role ID (Shigeru Hanada, Ashutosh Bapat, Etsuro Fujita)

    Previously, the foreign join pushdown infrastructure left the question of security entirely up to individual foreign data wrappers, but that made it too easy for anFDW to inadvertently create subtle security holes. So, make it the core code's job to determine which role ID will access each table, and do not attempt join pushdown unless the role is the same for all relevant relations.

E.57.3.5. Permissions Management

  • Use the privilege system to manage access to sensitive functions (Stephen Frost)

    Formerly, many security-sensitive functions contained hard-wired checks that would throw an error if they were called by a non-superuser. This forced the use of superuser roles for some relatively pedestrian tasks. The hard-wired error checks are now gone in favor of makinginitdb revoke the default publicEXECUTE privilege on these functions. This allows installations to choose to grant usage of such functions to trusted roles that do not need all superuser privileges.

  • Create somebuilt-in roles that can be used to grant access to what were previously superuser-only functions (Stephen Frost)

    Currently the only such role ispg_signal_backend, but more are expected to be added in future.

E.57.3.6. Data Types

E.57.3.7. Functions

  • Addjsonb_insert() function to insert a new element into ajsonb array, or a not-previously-existing key into ajsonb object (Dmitry Dolgov)

  • Improve the accuracy of theln(),log(),exp(), andpow() functions for typenumeric (Dean Rasheed)

  • Add ascale(numeric) function to extract the display scale of anumeric value (Marko Tiikkaja)

  • Add trigonometric functions that work in degrees (Dean Rasheed)

    For example,sind() measures its argument in degrees, whereassin() measures in radians. These functions go to some lengths to deliver exact results for values where an exact result can be expected, for instancesind(30) = 0.5.

  • Ensure that trigonometric functions handleinfinity andNaN inputs per thePOSIX standard (Dean Rasheed)

    ThePOSIX standard says that these functions should returnNaN forNaN input, and should throw an error for out-of-range inputs includinginfinity. Previously our behavior varied across platforms.

  • Maketo_timestamp(float8) convert floatinfinity to timestampinfinity (Vitaly Burovoy)

    Formerly it just failed on an infinite input.

  • Add new functions fortsvector data (Stas Kelvich)

    The new functions arets_delete(),ts_filter(),unnest(),tsvector_to_array(),array_to_tsvector(), and a variant ofsetweight() that sets the weight only for specified lexeme(s).

  • Allowts_stat() andtsvector_update_trigger() to operate on values that are of types binary-compatible with the expected argument type, not just exactly that type; for example allowcitext wheretext is expected (Teodor Sigaev)

  • Add variadic functionsnum_nulls() andnum_nonnulls() that count the number of their arguments that are null or non-null (Marko Tiikkaja)

    An example usage isCHECK(num_nonnulls(a,b,c) = 1) which asserts that exactly one of a,b,c is notNULL. These functions can also be used to count the number of null or nonnull elements in an array.

  • Add functionparse_ident() to split a qualified, possibly quotedSQL identifier into its parts (Pavel Stehule)

  • Into_number(), interpret aV format code as dividing by 10 to the power of the number of digits followingV (Bruce Momjian)

    This makes it operate in an inverse fashion toto_char().

  • Make theto_reg*() functions accept typetext notcstring (Petr Korobeinikov)

    This avoids the need to write an explicit cast in most cases where the argument is not a simple literal constant.

  • Addpg_size_bytes() function to convert human-readable size strings to numbers (Pavel Stehule, Vitaly Burovoy, Dean Rasheed)

    This function converts strings like those produced bypg_size_pretty() into bytes. An example usage isSELECT oid::regclass FROM pg_class WHERE pg_total_relation_size(oid) > pg_size_bytes('10 GB').

  • Inpg_size_pretty(), format negative numbers similarly to positive ones (Adrian Vondendriesch)

    Previously, negative numbers were never abbreviated, just printed in bytes.

  • Add an optionalmissing_ok argument to thecurrent_setting() function (David Christensen)

    This allows avoiding an error for an unrecognized parameter name, instead returning aNULL.

  • Change various catalog-inspection functions to returnNULL for invalid input (Michael Paquier)

    pg_get_viewdef() now returnsNULL if given an invalid viewOID, and several similar functions likewise returnNULL for bad input. Previously, such cases usually led tocache lookup failed errors, which are not meant to occur in user-facing cases.

  • Fixpg_replication_origin_xact_reset() to not have any arguments (Fujii Masao)

    The documentation said that it has no arguments, and the C code did not expect any arguments, but the entry inpg_proc mistakenly specified two arguments.

E.57.3.8. Server-Side Languages

  • Add a nonlocalized version of theseverity field in error and notice messages (Tom Lane)

    This change allows client code to determine severity of an error or notice without having to worry about localized variants of the severity strings.

  • Introduce a feature inlibpq whereby theCONTEXT field of messages can be suppressed, either always or only for non-error messages (Pavel Stehule)

    The default behavior ofPQerrorMessage() is now to printCONTEXT only for errors. The new functionPQsetErrorContextVisibility() can be used to adjust this.

  • Add support inlibpq for regenerating an error message with a different verbosity level (Alex Shulgin)

    This is done with the new functionPQresultVerboseErrorMessage(). This supportspsql's new\errverbose feature, and may be useful for other clients as well.

  • Improvelibpq'sPQhost() function to return useful data for default Unix-socket connections (Tom Lane)

    Previously it would returnNULL if no explicit host specification had been given; now it returns the default socket directory path.

  • Fixecpg's lexer to handle line breaks within comments starting on preprocessor directive lines (Michael Meskes)

E.57.3.10. Client Applications

  • Add a--strict-names option topg_dump andpg_restore (Pavel Stehule)

    This option causes the program to complain if there is no match for a-t or-n option, rather than silently doing nothing.

  • Inpg_dump, dump locally-made changes of privilege assignments for system objects (Stephen Frost)

    While it has always been possible for a superuser to change the privilege assignments for built-in or extension-created objects, such changes were formerly lost in a dump and reload. Now,pg_dump recognizes and dumps such changes. (This works only when dumping from a 9.6 or later server, however.)

  • Allowpg_dump to dump non-extension-owned objects that are within an extension-owned schema (Martín Marqués)

    Previously such objects were ignored because they were mistakenly assumed to belong to the extension owning their schema.

  • Inpg_dump output, include the table name in object tags for object types that are only uniquely named per-table (for example, triggers) (Peter Eisentraut)

E.57.3.10.1. psql
  • Support multiple-c and-f command-line options (Pavel Stehule, Catalin Iacob)

    The specified operations are carried out in the order in which the options are given, and thenpsql terminates.

  • Add a\crosstabview command that prints the results of a query in a cross-tabulated display (Daniel Vérité)

    In the crosstab display, data values from one query result column are placed in a grid whose column and row headers come from other query result columns.

  • Add an\errverbose command that shows the last server error at full verbosity (Alex Shulgin)

    This is useful after getting an unexpected error — you no longer need to adjust theVERBOSITY variable and recreate the failure in order to see error fields that are not shown by default.

  • Add\ev and\sv commands for editing and showing view definitions (Petr Korobeinikov)

    These are parallel to the existing\ef and\sf commands for functions.

  • Add a\gexec command that executes a query and re-submits the result(s) as new queries (Corey Huinker)

  • Allow\pset Cstring to set the table title, for consistency with\Cstring (Bruce Momjian)

  • In\pset expanded auto mode, do not use expanded format for query results with only one column (Andreas Karlsson, Robert Haas)

  • Improve the headers output by the\watch command (Michael Paquier, Tom Lane)

    Include the\pset title string if one has been set, and shorten the prefabricated part of the header to betimestamp (everyNs). Also, the timestamp format now obeyspsql's locale environment.

  • Improve tab-completion logic to consider the entire input query, not only the current line (Tom Lane)

    Previously, breaking a command into multiple lines defeated any tab completion rules that needed to see words on earlier lines.

  • Numerous minor improvements in tab-completion behavior (Peter Eisentraut, Vik Fearing, Kevin Grittner, Kyotaro Horiguchi, Jeff Janes, Andreas Karlsson, Fujii Masao, Thomas Munro, Masahiko Sawada, Pavel Stehule)

  • Add aPROMPT option%p to insert the process ID of the connected backend (Julien Rouhaud)

  • Introduce a feature whereby theCONTEXT field of messages can be suppressed, either always or only for non-error messages (Pavel Stehule)

    PrintingCONTEXT only for errors is now the default behavior. This can be changed by setting the special variableSHOW_CONTEXT.

  • Make\df+ show function access privileges and parallel-safety attributes (Michael Paquier)

E.57.3.10.2. pgbench
  • SQL commands inpgbench scripts are now ended by semicolons, not newlines (Kyotaro Horiguchi, Tom Lane)

    This change allows SQL commands in scripts to span multiple lines. Existing custom scripts will need to be modified to add a semicolon at the end of each line that does not have one already. (Doing so does not break the script for use with older versions ofpgbench.)

  • Support floating-point arithmetic, as well as somebuilt-in functions, in expressions in backslash commands (Fabien Coelho)

  • Replace\setrandom with built-in functions (Fabien Coelho)

    The new built-in functions includerandom(),random_exponential(), andrandom_gaussian(), which perform the same work as\setrandom, but are easier to use since they can be embedded in larger expressions. Since these additions have made\setrandom obsolete, remove it.

  • Allow invocation of multiple copies of the built-in scripts, not only custom scripts (Fabien Coelho)

    This is done with the new-b switch, which works similarly to-f for custom scripts.

  • Allow changing the selection probabilities (weights) for scripts (Fabien Coelho)

    When multiple scripts are specified, eachpgbench transaction randomly chooses one to execute. Formerly this was always done with uniform probability, but now different selection probabilities can be specified for different scripts.

  • Collect statistics for each script in a multi-script run (Fabien Coelho)

    This feature adds an intermediate level of detail to existing global and per-command statistics printouts.

  • Add a--progress-timestamp option to report progress with Unix epoch timestamps, instead of time since the run started (Fabien Coelho)

  • Allow the number of client connections (-c) to not be an exact multiple of the number of threads (-j) (Fabien Coelho)

  • When the-T option is used, stop promptly at the end of the specified time (Fabien Coelho)

    Previously, specifying a low transaction rate could causepgbench to wait significantly longer than specified.

E.57.3.11. Server Applications

  • Improve error reporting duringinitdb's post-bootstrap phase (Tom Lane)

    Previously, an error here led to reporting the entire input file as thefailing query; now just the current query is reported. To get the desired behavior, queries ininitdb's input files must be separated by blank lines.

  • Speed upinitdb by using just one standalone-backend session for all the post-bootstrap steps (Tom Lane)

  • Improvepg_rewind so that it can work when the target timeline changes (Alexander Korotkov)

    This allows, for example, rewinding a promoted standby back to some state of the old master's timeline.

E.57.3.12. Source Code

  • Allow extension-provided operators and functions to be sent for remote execution, if the extension is whitelisted in the foreign server's options (Paul Ramsey)

    Users can enable this feature when the extension is known to exist in a compatible version in the remote database. It allows more efficient execution of queries involving extension operators.

  • Consider performing sorts on the remote server (Ashutosh Bapat)

  • Consider performing joins on the remote server (Shigeru Hanada, Ashutosh Bapat)

  • When feasible, performUPDATE orDELETE entirely on the remote server (Etsuro Fujita)

    Formerly, remote updates involved sending aSELECT FOR UPDATE command and then updating or deleting the selected rows one-by-one. While that is still necessary if the operation requires any local processing, it can now be done remotely if all elements of the query are safe to send to the remote server.

  • Allow the fetch size to be set as a server or table option (Corey Huinker)

    Formerly,postgres_fdw always fetched 100 rows at a time from remote queries; now that behavior is configurable.

  • Use a single foreign-server connection for local user IDs that all map to the same remote user (Ashutosh Bapat)

  • Transmit query cancellation requests to the remote server (Michael Paquier, Etsuro Fujita)

    Previously, a local query cancellation request did not cause an already-sent remote query to terminate early.


Prev Home Next
E.56. Release 9.6.1 Up E.58. Prior Releases
pdfepub
Go to Postgres Pro Standard 9.6
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp