Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en juillet

PostgreSQL Local

PostgreSQL dans les média

PostgreSQL Weekly News / les nouvelles hebdomadaires vous sont offertes cette semaine par David Fetter. Traduction par l'équipe PostgreSQLFr sous licence CC BY-NC-SA.

Proposez vos articles ou annonces avant dimanche 15:00 (heure du Pacifique). Merci de les envoyer en anglais à david (a) fetter.org, en allemand à pwn (a) pgug.de, en italien à pwn (a) itpug.org et en espagnol à pwn (a) arpug.com.ar.

(lien vers l'article original)

Correctifs appliqués

Heikki Linnakangas a poussé :

  • Retry short writes when flushing WAL. We don't normally bother retrying when the number of bytes written by write() is short of what was requested. It is generally assumed that a write() to disk doesn't return short, unless you run out of disk space. While writing the WAL, however, it seems prudent to try a bit harder, because a failure leads to PANIC. The write() is also much larger than most write()s in the backend (up to wal_buffers), so there's more room for surprises. Also retry on EINTR. All signals used in the backend are flagged SA_RESTART nowadays, so it shouldn't happen, but better to be defensive. http://git.postgresql.org/pg/commitdiff/79ce29c734c6a652b2f7193bda537cff0c8eb8c1
  • Optimize pglz compressor for small inputs. The pglz compressor has a significant startup cost, because it has to initialize to zeros the history-tracking hash table. On a 64-bit system, the hash table was 64kB in size. While clearing memory is pretty fast, for very short inputs the relative cost of that was quite large. This patch alleviates that in two ways. First, instead of storing pointers in the hash table, store 16-bit indexes into the hist_entries array. That slashes the size of the hash table to 1/2 or 1/4 of the original, depending on the pointer width. Secondly, adjust the size of the hash table based on input size. For very small inputs, you don't need a large hash table to avoid collisions. Review by Amit Kapila. http://git.postgresql.org/pg/commitdiff/031cc55bbea6b3a6b67c700498a78fb1d4399476
  • Silence compiler warning in assertion-enabled builds. With -Wtype-limits, gcc correctly points out that size_t can never be < 0. Backpatch to 9.3 and 9.2. It's been like this forever, but in <= 9.1 you got a lot other warnings with -Wtype-limits anyway (at least with my version of gcc). Andres Freund http://git.postgresql.org/pg/commitdiff/d2e71ff7573e67fc0a263d0ba6fe2ffbc175d1ad

Bruce Momjian a poussé :

Robert Haas a poussé :

  • Add a convenience routine makeFuncCall to reduce duplication. David Fetter and Andrew Gierth, reviewed by Jeevan Chalke http://git.postgresql.org/pg/commitdiff/0d22987ae9fe5dc9861e314f1609c8b69d61bbfc
  • Use an MVCC snapshot, rather than SnapshotNow, for catalog scans. SnapshotNow scans have the undesirable property that, in the face of concurrent updates, the scan can fail to see either the old or the new versions of the row. In many cases, we work around this by requiring DDL operations to hold AccessExclusiveLock on the object being modified; in some cases, the existing locking is inadequate and random failures occur as a result. This commit doesn't change anything related to locking, but will hopefully pave the way to allowing lock strength reductions in the future. The major issue has held us back from making this change in the past is that taking an MVCC snapshot is significantly more expensive than using a static special snapshot such as SnapshotNow. However, testing of various worst-case scenarios reveals that this problem is not severe except under fairly extreme workloads. To mitigate those problems, we avoid retaking the MVCC snapshot for each new scan; instead, we take a new snapshot only when invalidation messages have been processed. The catcache machinery already requires that invalidation messages be sent before releasing the related heavyweight lock; else other backends might rely on locally-cached data rather than scanning the catalog at all. Thus, making snapshot reuse dependent on the same guarantees shouldn't break anything that wasn't already subtly broken. Patch by me. Review by Michael Paquier and Andres Freund. http://git.postgresql.org/pg/commitdiff/568d4138c646cd7cd8a837ac244ef2caf27c6bb8
  • Add support for multiple kinds of external toast datums. To that end, support tags rather than lengths for external datums. As an example of how this can be used, add support or "indirect" tuples which point to some externally allocated memory containing a toast tuple. Similar infrastructure could be used for other purposes, including, perhaps, support for alternative compression algorithms. Andres Freund, reviewed by Hitoshi Harada and myself http://git.postgresql.org/pg/commitdiff/3682025015390a8e802e0752589162db7bd70b5d
  • Additional regression tests for CREATE OPERATOR. Robins Tharakan, reviewed by Szymon Guz http://git.postgresql.org/pg/commitdiff/ada3e776c2a4825ed0387e4bcf335139b101ca98
  • Regression tests for LISTEN/NOTIFY/UNLISTEN/pg_notify. Robins Tharakan, reviewed by Szymon Guz http://git.postgresql.org/pg/commitdiff/00a7767fcc2e4d90e3b4cacb87974ec5a0f32b8c
  • Hopefully-portable regression tests for CREATE/ALTER/DROP COLLATION. The collate.linux.utf8 test covers some of the same territory, but isn't portable and so probably does not get run often, or on non-Linux platforms. If this approach turns out to be sufficiently portable, we may want to look at trimming the redundant tests out of that file to avoid duplication. Robins Tharakan, reviewed by Michael Paquier and Fabien Coelho, with further changes and cleanup by me. http://git.postgresql.org/pg/commitdiff/263645305b8f14a3821e04dffa96fa7c1bc2ae86
  • Revert "Hopefully-portable regression tests for CREATE/ALTER/DROP COLLATION." This reverts commit 263645305b8f14a3821e04dffa96fa7c1bc2ae86. The buildfarm is sad. http://git.postgresql.org/pg/commitdiff/f33c53ec5b27a90a0f00ac27d4e5178fcc33168f
  • docs: Clarify flag dependencies for background workers. BGWORKER_BACKEND_DATABASE_CONNECTION can only be used if BGWORKER_SHMEM_ACCESS is also used. Michael Paquier, with some tweaks by me. http://git.postgresql.org/pg/commitdiff/5cbe935c9d6046f5600ff2e083b4bae6ee1f4aa2
  • Add new GUC, max_worker_processes, limiting number of bgworkers. In 9.3, there's no particular limit on the number of bgworkers; instead, we just count up the number that are actually registered, and use that to set MaxBackends. However, that approach causes problems for Hot Standby, which needs both MaxBackends and the size of the lock table to be the same on the standby as on the master, yet it may not be desirable to run the same bgworkers in both places. 9.3 handles that by failing to notice the problem, which will probably work fine in nearly all cases anyway, but is not theoretically sound. A further problem with simply counting the number of registered workers is that new workers can't be registered without a postmaster restart. This is inconvenient for administrators, since bouncing the postmaster causes an interruption of service. Moreover, there are a number of applications for background processes where, by necessity, the background process must be started on the fly (e.g. parallel query). While this patch doesn't actually make it possible to register new background workers after startup time, it's a necessary prerequisite. Patch by me. Review by Michael Paquier. http://git.postgresql.org/pg/commitdiff/6bc8ef0b7f1f1df3998745a66e1790e27424aa0c

Peter Eisentraut a poussé :

Andrew Dunstan a poussé :

  • Improve support for building PGXS modules with VPATH. A VPATH build will be performed when the module's make file path is not the current directory or when USE_VPATH is set. This will assist packagers and others who prefer to build without polluting the source directories. There is still a bit of work to do here, notably documentation, but it's probably a good idea to commit what we have so far and let people test it out on their modules. Cédric Villemain, with an addition from me. http://git.postgresql.org/pg/commitdiff/6697aa2bc25c83b88d6165340348a31328c35de6
  • Install all a Makefile's extension controls, not just the first. Bug introduced by commit 6697aa2bc25c83b88d6165340348a31328c35de6 and reported by Robert Haas. http://git.postgresql.org/pg/commitdiff/82b0102650cf85268145a46f0ab488bacf6599a1

Alvaro Herrera a poussé :

Noah Misch a poussé :

  • Expose object name error fields in PL/pgSQL. Specifically, permit attaching them to the error in RAISE and retrieving them from a caught error in GET STACKED DIAGNOSTICS. RAISE enforces nothing about the content of the fields; for its purposes, they are just additional string fields. Consequently, clarify in the protocol and libpq documentation that the usual relationships between error fields, like a schema name appearing wherever a table name appears, are not universal. This freedom has other applications; consider a FDW propagating an error from an RDBMS having no schema support. Back-patch to 9.3, where core support for the error fields was introduced. This prevents the confusion of having a release where libpq exposes the fields and PL/pgSQL does not. Pavel Stehule, lexical revisions by Noah Misch. http://git.postgresql.org/pg/commitdiff/7cd9b1371d8b18d063dc38bc4fa7b30bd92c07a3
  • Use type "int64" for memory accounting in tuplesort.c/tuplestore.c. Commit 263865a48973767ce8ed7b7788059a38a24a9f37 switched tuplesort.c and tuplestore.c variables representing memory usage from type "long" to type "Size". This was unnecessary; I thought doing so avoided overflow scenarios on 64-bit Windows, but guc.c already limited work_mem so as to prevent the overflow. It was also incomplete, not touching the logic that assumed a signed data type. Change the affected variables to "int64". This is perfect for 64-bit platforms, and it reduces the need to contemplate platform-specific overflow scenarios. It also puts us close to being able to support work_mem over 2 GiB on 64-bit Windows. Per report from Andres Freund. http://git.postgresql.org/pg/commitdiff/79e0f87a15643efa9a94e011da509746dbb96798
  • Update messages, comments and documentation for materialized views. All instances of the verbiage lagging the code. Back-patch to 9.3, where materialized views were introduced. http://git.postgresql.org/pg/commitdiff/02d2b694ee42a9e241d37ce67df122fff43d5bb9

Tom Lane a poussé :

  • Fix handling of auto-updatable views on inherited tables. An INSERT into such a view should work just like an INSERT into its base table, ie the insertion should go directly into that table ... not be duplicated into each child table, as was happening before, per bug #8275 from Rushabh Lathia. On the other hand, the current behavior for UPDATE/DELETE seems reasonable: the update/delete traverses the child tables, or not, depending on whether the view specifies ONLY or not. Add some regression tests covering this area. Dean Rasheed http://git.postgresql.org/pg/commitdiff/5530a826434a8d4bc6ba7387d05aa14755406199
  • Rename a function to avoid naming conflict in parallel regression tests. Commit 31a891857a128828d47d93c63e041f3b69cbab70 added some tests in plpgsql.sql that used a function rather unthinkingly named "foo()". However, rangefuncs.sql has some much older tests that create a function of that name, and since these test scripts run in parallel, there is a chance of failures if the timing is just right. Use another name to avoid that. Per buildfarm (failure seen today on "hamerkop", but probably it's happened before and not been noticed). http://git.postgresql.org/pg/commitdiff/0cd787802f84583c4086b1af0a74015f230dfb70
  • Fix planning of parameterized appendrel paths with expensive join quals. The code in set_append_rel_pathlist() for building parameterized paths for append relations (inheritance and UNION ALL combinations) supposed that the cheapest regular path for a child relation would still be cheapest when reparameterized. Which might not be the case, particularly if the added join conditions are expensive to compute, as in a recent example from Jeff Janes. Fix it to compare child path costs *after* reparameterizing. We can short-circuit that if the cheapest pre-existing path is already parameterized correctly, which seems likely to be true often enough to be worth checking for. Back-patch to 9.2 where parameterized paths were introduced. http://git.postgresql.org/pg/commitdiff/5372275b4b5fc183c6c6dd4517cfd74d5b641446

Fujii Masao a poussé :

Michael Meskes a poussé :

Magnus Hagander a poussé :

Jeff Davis a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Fabien COELHO sent in another revision of a patch to add a --progress option to pgbench.
  • Robins Tharakan sent in another revision of a patch to add more regression tests for CREATE OPERATOR.
  • Fabrízio de Royes Mello sent in a patch to add /converage/, produced by "make coverage", to .gitignore.
  • Pavel Stehule sent in another revision of a patch to check in the parser that the argument to a variadic function is an array.
  • James Sewell sent in a patch to add an ldapoption to disable chasing LDAP referrals.
  • Fabien COELHO sent in two more revisions of a patch to add a "big" target for make, intended to exercise more of the code than developers (as opposed to, for example, CI systems) would ordinarily do manually.
  • Nicholas White sent in another revision of a patch to enable RESPECT/IGNORE NULLS in window functions.
  • Robins Tharakan sent in two more revisions of a patch to add regression tests for DISCARD.
  • Hari Babu sent in another revision of a patch to improvement performance by reducing WAL for update operations.
  • Peter Eisentraut sent in another revision of a patch to update the recommended .emacs file.
  • Etsuro Fujita sent in another revision of a patch to remove unused targets.
  • Tom Lane sent in a patch to fix an issue with LATERAL quals.
  • Michael Paquier and Fujii Masao traded patches implementing REINDEX CONCURRENTLY.
  • Pavel Stehule sent in two revisions of a patch to fix BUG #7873: pg_restore --clean tries to drop tables that don't exist.
  • Andres Freund sent in another revision of a patch to remove PD_ALL_VISIBLE.
  • Maciej Gajewski sent in another revision of a patch to enable querying result history in psql.
  • Ian Lawrence Barwick sent in a patch to remove superfluous semicolons from pg_dump.
  • Pavel Stehule sent in a patch to create a simple date constructor from numeric values.
  • Fujii Masao sent in another revision of a patch to fix pgstattuple/pgstatindex to use regclass-type as the argument.
  • KONDO Mitsumasa sent in another revision of a patch to improve checkpoint IO scheduler for stable transaction responses.
  • David Fetter sent in another revision of a patch to add WITH ORDINALITY to UNNEST and other set-returning functions.
  • Dean Rasheed and Pavel Stehule traded patches to add WITH CHECK OPTION to auto-updateable views.
  • Robert Haas sent in another revision of a patch to add regression tests for ROLE (USER).
  • Michael Paquier sent in another revision of a patch to add Damerau-Levenshtein distance to contrib/fuzzystrmatch.
  • Amit Kapila sent in another revision of a patch to add an ALTER SYSTEM command, which allows users to set GUCs from SQL and have those changes persist across server restarts.
  • Hari Babu sent in two more revisions of a patch to compute the max LSN of pages.
  • Karol Trzcionka sent in two revisions of a patch to implement UPDATE ... RETURNING {BEFORE, AFTER}.
  • Dimitri Fontaine sent in another revision of a patch to implement EXTENSION templates.
  • Ivan Babrou sent in a patch to refine the precision of libpq's connect_timeout to millisecond precision.
  • Satoshi Nagayasu sent in another revision of a patch to update pg_filedump for page checksums, etc.
  • Noah Misch sent in a patch to have REFRESH MATERIALIZED VIEW run as the MATERIALIZED VIEW owner.
  • David Fetter and Dean Rasheed traded patches to implement FILTER for aggregates per the SQL spec.
  • Kevin Grittner sent in another revision of a patch to implement REFRESH MATERIALIZED VIEW CONCURRENTLY.
  • Peter Eisentraut sent in a patch to change a boolean with three states to an enum in path_encode().
  • Andres Freund sent in a patch to remove a wrongly copy/pasted include guard in attoptcache.h.
  • Sawada Masahiko sent in another revision of a patch to allow for a fail-back without a fresh backup.
  • Robins Tharakan sent in another revision of a patch to add more tests for SCHEMA.
  • Robins Tharakan sent in another revision of a patch to add more tests for SEQUENCE.
  • Simon Riggs sent in another revision of a patch to reduce lock levels for certain DDL operations.
  • Josh Kupershmidt sent in another revision of a patch to make vacuumlo use a cursor.
  • Robins Tharakan sent in another revision of a patch to add more tests for DB-changing commands.
  • Robins Tharakan sent in another revision of a patch to add more tests for LOCK TABLE.
  • Robins Tharakan sent in another revision of a patch to add more tests for SET xxx.
  • Andres Freund sent in another revision of a patch set to implement parts of logical changeset generation.
  • Hadi Moshayedi sent in another revision of a patch to add an optional parameter to an aggregate function which gives the expected size in bytes of the memory it uses for state.