La pgConf UK 2018 se tiendra le 3 juillet 2018 à Londres. L'appel à conférenciers est ouvert jusqu'au 31 mars 2018 à l'adresse : http://www.pgconf.uk/papers http://www.pgconf.uk/

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en février

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. La version originale se trouve à l'adresse suivante : http://www.postgresql.org/message-id/20180226012132.GA7111@fetter.org

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.

Correctifs appliqués

Peter Eisentraut pushed:

Tom Lane pushed:

  • Remove redundant initialization of a local variable. In what was doubtless a typo, commit bf6c614a2 introduced a duplicate initialization of a local variable. This made Coverity unhappy, as well as pretty much anybody reading the code. We don't even have a real use for the local variable, so just remove it. https://git.postgresql.org/pg/commitdiff/8c44802b6ed4846accb08e2ffe93040b8b42aae9
  • Remove bogus "extern" annotations on function definitions. While this is not illegal C, project style is to put "extern" only on declarations not definitions. David Rowley Discussion: https://postgr.es/m/CAKJS1f9RKLWXcMBQhvDYhmsMEo+ALuNgA-NE+AX5Uoke9DJ2Xg@mail.gmail.com https://git.postgresql.org/pg/commitdiff/524d64ea8e3e49b4fda41ff9b2f048b697384058
  • Fix misbehavior of CTE-used-in-a-subplan during EPQ rechecks. An updating query that reads a CTE within an InitPlan or SubPlan could get incorrect results if it updates rows that are concurrently being modified. This is caused by CteScanNext supposing that nothing inside its recursive ExecProcNode call could change which read pointer is selected in the CTE's shared tuplestore. While that's normally true because of scoping considerations, it can break down if an EPQ plan tree gets built during the call, because EvalPlanQualStart builds execution trees for all subplans whether they're going to be used during the recheck or not. And it seems like a pretty shaky assumption anyway, so let's just reselect our own read pointer here. Per bug #14870 from Andrei Gorita. This has been broken since CTEs were implemented, so back-patch to all supported branches. Discussion: https://postgr.es/m/20171024155358.1471.82377@wrigleys.postgresql.org https://git.postgresql.org/pg/commitdiff/159efe4af4509741c25d6b95ddd9fda86facce42
  • Fix pg_dump's logic for eliding sequence limits that match the defaults. The previous coding here applied atoi() to strings that could represent values too large to fit in an int. If the overflowed value happened to match one of the cases it was looking for, it would drop that limit value from the output, leading to incorrect restoration of the sequence. Avoid the unsafe behavior, and also make the logic cleaner by explicitly calculating the default min/max values for the appropriate kind of sequence. Reported and patched by Alexey Bashtanov, though I whacked his patch around a bit. Back-patch to v10 where the faulty logic was added. Discussion: https://postgr.es/m/cb85a9a5-946b-c7c4-9cf2-6cd6e25d7a33@imap.cc https://git.postgresql.org/pg/commitdiff/3486bcf9e89d87b59d0e370af098fda38be97209
  • Repair pg_upgrade's failure to preserve relfrozenxid for matviews. This oversight led to data corruption in matviews, manifesting as "could not access status of transaction" before our most recent releases, and "found xmin from before relfrozenxid" errors since then. The proximate cause of the problem seems to have been confusion between the task of preserving dropped-column status and the task of preserving frozenxid status. Those are required for distinct sets of relkinds, and the reasoning was entirely undocumented in the source code. In hopes of forestalling future errors of the same kind, try to improve the commentary in this area. In passing, also improve the remarkably unhelpful comments around pg_upgrade's set_frozenxids(). That's not actually buggy AFAICS, but good luck figuring out what it does from the old comments. Per report from Claudio Freire. It appears that bug #14852 from Alexey Ermakov is an earlier report of the same issue, and there may be other cases that we failed to identify at the time. Patch by me based on analysis by Andres Freund. The bug dates back to the introduction of matviews, so back-patch to all supported branches. Discussion: https://postgr.es/m/CAGTBQpbrY9CdRGGhyBZ9yqY4jWaGC85rUF4X+R7d-aim=mBNsw@mail.gmail.com Discussion: https://postgr.es/m/20171013115320.28049.86457@wrigleys.postgresql.org https://git.postgresql.org/pg/commitdiff/38b41f182a66b67e36e2adf53d078599b1b65483
  • Fix planner failures with overlapping mergejoin clauses in an outer join. Given overlapping or partially redundant join clauses, for example t1 JOIN t2 ON t1.a = t2.x AND t1.b = t2.x the planner's EquivalenceClass machinery will ordinarily refactor the clauses as "t1.a = t1.b AND t1.a = t2.x", so that join processing doesn't see multiple references to the same EquivalenceClass in a list of join equality clauses. However, if the join is outer, it's incorrect to derive a restriction clause on the outer side from the join conditions, so the clause refactoring does not happen and we end up with overlapping join conditions. The code that attempted to deal with such cases had several subtle bugs, which could result in "left and right pathkeys do not match in mergejoin" or "outer pathkeys do not match mergeclauses" planner errors, if the selected join plan type was a mergejoin. (It does not appear that any actually incorrect plan could have been emitted.) The core of the problem really was failure to recognize that the outer and inner relations' pathkeys have different relationships to the mergeclause list. A join's mergeclause list is constructed by reference to the outer pathkeys, so it will always be ordered the same as the outer pathkeys, but this cannot be presumed true for the inner pathkeys. If the inner sides of the mergeclauses contain multiple references to the same EquivalenceClass ({t2.x} in the above example) then a simplistic rendering of the required inner sort order is like "ORDER BY t2.x, t2.x", but the pathkey machinery recognizes that the second sort column is redundant and throws it away. The mergejoin planning code failed to account for that behavior properly. One error was to try to generate cut-down versions of the mergeclause list from cut-down versions of the inner pathkeys in the same way as the initial construction of the mergeclause list from the outer pathkeys was done; this could lead to choosing a mergeclause list that fails to match the outer pathkeys. The other problem was that the pathkey cross-checking code in create_mergejoin_plan treated the inner and outer pathkey lists identically, whereas actually the expectations for them must be different. That led to false "pathkeys do not match" failures in some cases, and in principle could have led to failure to detect bogus plans in other cases, though there is no indication that such bogus plans could be generated. Reported by Alexander Kuzmenkov, who also reviewed this patch. This has been broken for years (back to around 8.3 according to my testing), so back-patch to all supported branches. Discussion: https://postgr.es/m/5dad9160-4632-0e47-e120-8e2082000c01@postgrespro.ru https://git.postgresql.org/pg/commitdiff/9afd513df042b22b98bb9b55f27265e95d34f9e6
  • Allow auto_explain.log_min_duration to go up to INT_MAX. The previous limit of INT_MAX / 1000 seems to have been cargo-culted in from somewhere else. Or possibly the value was converted to microseconds at some point; but in all supported releases, it's just compared to other values, so there's no need for the restriction. This change raises the effective limit from ~35 minutes to ~24 days, which conceivably is useful to somebody, and anyway it's more consistent with the range of the core log_min_duration_statement GUC. Per complaint from Kevin Bloch. Back-patch to all supported releases. Discussion: https://postgr.es/m/8ea82d7e-cb78-8e05-0629-73aa14d2a0ca@codingthat.com https://git.postgresql.org/pg/commitdiff/8af87f411c151537b6e3315c2a191110c3fec494
  • Fix brown-paper-bag bug in commit 0a459cec96d3856f476c2db298c6b52f592894e8. RANGE_OFFSET comparisons need to examine the first ORDER BY column, which isn't necessarily the first column in the incoming tuples. No idea how this slipped through initial testing. Per bug #15082 from Zhou Digoal. Discussion: https://postgr.es/m/151939899974.1461.9411971793110285476@wrigleys.postgresql.org https://git.postgresql.org/pg/commitdiff/9fe802c8185e9a53158b6797d0f6fd8bfbb01af1
  • First-draft release notes for 10.3. https://git.postgresql.org/pg/commitdiff/eec1a8cb6cbc6ea44cf58cfaeaa01ad8ee2bc8e8
  • Add window RANGE support for float4, float8, numeric. Commit 0a459cec9 left this for later, but since time's running out, I went ahead and took care of it. There are more data types that somebody might someday want RANGE support for, but this is enough to satisfy all expectations of the SQL standard, which just says that "numeric, datetime, and interval" types should have RANGE support. https://git.postgresql.org/pg/commitdiff/8b29e88cdce17705f0b2c43e50219ce1d7d2f603
  • Fix thinko in in_range_float4_float8. I forgot the coding rule for correct use of Float8GetDatumFast. Per buildfarm. https://git.postgresql.org/pg/commitdiff/32291aed494d425a548e45b3b6ad95f9d5c94e67
  • Release notes for 10.3, 9.6.8, 9.5.12, 9.4.17, 9.3.22. https://git.postgresql.org/pg/commitdiff/1316417bbab0821f99eb21c0b654e33f5f6f90a4
  • Un-break parallel pg_upgrade. Commit b3f840120 changed pg_upgrade so that it'd actually drop and re-create the template1 and postgres databases in the new cluster. That works fine, serially. With the -j option it's not so fine, because other per-database jobs might be launched while the template1 database is dropped. Since they attempt to connect there to start up, kaboom. This is the cause of the intermittent failures buildfarm member jacana has been showing for the last month; evidently it is the only BF member configured to run the pg_upgrade test with parallelism enabled. Fix by processing template1 separately before we get into the parallel sub-job launch loop. (We could alternatively have made the postgres DB be the special case, but it seems likely that template1 will contain less stuff and so we lose less parallelism with this choice.) https://git.postgresql.org/pg/commitdiff/5b570d771b80aadc98755208f8f1b81e9a5eb366

�lvaro Herrera pushed:

Magnus Hagander pushed:

Andres Freund pushed:

Robert Haas pushed:

Noah Misch pushed:

Correctifs en attente

David Rowley sent in another revision of a patch to remove [Merge]Append nodes which contain a single subpath.

Ildus Kurbangaliev sent in another revision of a patch to add a prefix operator that works with SP-GiST indexes.

Fabien COELHO sent in another revision of a patch to pgbench to add a method for determining whether a variable exists.

Artur Zakirov sent in a patch to add a snowball dictionary for Nepali.

Amit Langote sent in a patch to adjust partitioned table tests in insert_conflict.sql and fix ON CONFLICT DO NOTHING with partitioned indexes.

Konstantin Knizhnik sent in another revision of a patch to split lock chains into pairs in order to avoid O(N^2) behavior.

Laurenz Albe sent in a patch to implement NEXT VALUE FOR sequence.

Anastasia Lubennikova sent in two revisions of a patch to return a heaptuple from B-Tree index-only scans.

Joe Conway sent in another revision of a patch to add TOAST tables to some more catalog tables.

Takayuki Tsunakawa sent in two revisions of a patch to fix the documentation of how to calculate vm.nr_hugepages.

Takayuki Tsunakawa sent in another revision of a patch to zero-fill WAL blocks on standbys.

Amit Langote sent in five more revisions of a patch to speed up partition pruning.

Takayuki Tsunakawa sent in a patch to change the default value of wal_sync_method to open_datasync on Linux.

Ashutosh Bapat sent in a patch to fix some expression errors with "FOR UPDATE" using the postgres_fdw with partition-wise join enabled.

Fabien COELHO sent in another revision of a patch to allow pgbench to specify scale as a size.

Matheus de Oliveira sent in a patch to add support for add support for uuid, bool, name, bpchar and anyrange to btree_gin.

Haozhou Wang sent in a patch to Add missing type conversion functions for PL/Python

Matheus de Oliveira sent in a patch to add support for add support for uuid, bool, name, bpchar and anyrange to btree_gin.

Haozhou Wang sent in a patch to add missing type conversion functions for PL/PythonU.

Matheus de Oliveira sent in a patch to add support for ON UPDATE/DELETE actions on ALTER CONSTRAINT.

Aleksander Alekseev sent in a patch to add a few suppression rules for Valgrind.

Andrew Dunstan and David Rowley traded patches to speed up the execution of ALTER TABLE ... ADD COLUMN ... DEFAULT.

Tomas Vondra sent in another revision of a patch to add Bloom filters to hash joins.

Peter Eisentraut sent in a patch for PL/pgsql to allow committing inside a cursor loop in stored procedures.

Andres Freund sent in a patch to refactor TupleTableSlot.

Peter Eisentraut sent in a patch to support parameters in CALL.

Kyotaro HORIGUCHI sent in another revision of a patch to implement asynchronous execution.

Daniel Gustafsson sent in a patch to increase the linebuf in the isolation spec scanner.

Daniel Gustafsson sent in a patch to allow # comments in the isolation spec SQL blocks.

David Rowley sent in a patch to fix an article in the documentation of ALTER TABLE ... ATTACH PARTITION.

Peter Eisentraut sent in a patch to use file cloning in pg_upgrade and CREATE DATABASE.

Haribabu Kommi sent in another revision of a patch to implement pluggable storage.

Etsuro Fujita sent in another revision of a patch to implement tuple routing for foreign partitions.

David Rowley sent in another revision of a patch to prune partitions more efficiently at runtime.

Magnus Hagander sent in three revisions of a patch to make it possible to turn on checksums while the instance is running.

Nikolay Shaplov sent in a patch to replace StdRdOptions with individual binary reloptions representation for each relation kind.

Dmitry Dolgov sent in another revision of a patch to implement generic type subscripting and use same for arrays and JSONB.

Alexander Kuzmenkov sent in another revision of a patch to allow full merge joins on comparisons other than equality.

Robert Haas sent in another revision of a patch to implement partition-wise aggregation/grouping.

Thomas Munro sent in another revision of a patch to make parallel queries work under SERIALIZABLE isolation.

David Rowley sent in a patch to generate PartitionClauseInfos for OR clauses, which should help prune partitions faster at runtime.

Magnus Hagander sent in four more revisions of a patch to allow workers to override datallowconn.

Peter Geoghegan sent in a patch to fix double free of tuple with grouping sets/tuplesort.c.

John Naylor sent in another revision of a patch to refactor how bootstrap data is created and handled.

Thomas Munro sent in a patch to format the isolation tester results more neatly.

David Rowley sent in another revision of a patch to prune partitions at runtime.

�lvaro Herrera sent in a patch to allow FOR EACH ROW triggers on partitioned tables.

Micha�l Paquier sent in a patch to monitor xlogreader garbage.

Peter Eisentraut sent in a patch to allow setting an external command for prompting for SSL passphrases.

Robert Haas sent in a patch to fix some infelicities between parallel append and UNION ALL.

David G. Johnston sent in a patch to fix filtering of unsupported relations in pgoutput.

Thomas Munro sent in a patch to update parallel.sgml's treatment of parallel joins.

Tomas Vondra sent in another revision of a patch to implement multivariate histograms and MCV lists.

Peter Eisentraut sent in another revision of a patch to add a prokind column, replacing the proisagg and proiswindow columns.

Tomas Vondra sent in another revision of a patch to implement BRIN multi-range indexes.

Peter Eisentraut sent in a patch to remove pg_class.relhaspkey.

Peter Eisentraut sent in a patch to handle heap rewrites better in logical decoding.

Michail Nikolaev sent in another revision of a patch to add a count for the new GiST VACUUM.

Chapman Flack sent in a patch to zero the headers of unused pages after WAL switch.

Yura Sokolov sent in a patch to add a header for customized qsorts.