Nouvelles hebdomadaires de PostgreSQL - 21 décembre 2014
Publication de PostgreSQL 9.4 !
http://www.postgresql.org/docs/9.4/static/release-9-4.html
[fr : http://blog.postgresql.fr/index.php?post/2014/12/18/PostgreSQL-9.4.0]
Le groupe Meetup de Moscou célèbrera la sortie de PostgreSQL 9.4 le mardi 23 décembre dans les bureaux de Parallels. Détails et RSVP : http://PostgreSQLRussia.org
Le PUG de Bulgarie est sur pied : http://bgpug.org/
Offres d'emplois autour de PostgreSQL en décembre
- Internationales : http://archives.postgresql.org/pgsql-jobs/2014-12/threads.php;
- Francophones : http://forums.postgresql.fr/viewforum.php?id=4.
PostgreSQL Local
- PGDay pré-FOSDEM (30 janvier 2015) et dev room PostgreSQL au FOSDEM (31 janvier - 1er février 2015) : http://fosdem2015.pgconf.eu/
- Le Prague PostgreSQL Developer Day (P2D2) 2015 aura lieu à Prague, République Tchèque, les 11 & 12 février 2015 : http://www.p2d2.cz/
- Le meetup du 18 février 2015 à Melbourne accueillera Gabriele Bartolini à propos de PostgreSQL 9.4 pour les devops. Détails ci-après, et RSVP : http://www.meetup.com/melpug/events/219082475/
- pgDaySF 2015 aura lieu le 10 mars 2015 à Burlingame (Californie) : http://sfpostgres.org/pgday-sf-2015-call-for-speakers-and-sponsors/
- L'appel à conférenciers pour le Nordic PostgreSQL Day 2015, prévu le 11 mars 2015 à Copenhague (Danemark), est lancé : http://2015.nordicpgday.org/cfp/
- L'appel à conférenciers pour la PGConf US 2015 court jusqu'au 17 décembre 2014. Les notifications seront envoyées le 10 janvier. L'événement aura lieu à New-York du 25 au 27 mars 2015 : http://nyc.pgconf.us/2015/
PostgreSQL dans les média
- Planet PostgreSQL : http://planet.postgresql.org/
- Planet PostgreSQLFr : http://planete.postgresql.fr/
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
Tom Lane a poussé :
- Improve documentation around parameter-setting and ALTER SYSTEM. The ALTER SYSTEM ref page hadn't been held to a very high standard, nor was the feature well integrated into section 18.1 (parameter setting). Also, though commit 4c4654afe had improved the structure of 18.1, it also introduced a lot of poor wording, imprecision, and outright falsehoods. Try to clean that up. http://git.postgresql.org/pg/commitdiff/af06aa822dbc023f3a103278ec381e1c88d67db1
- Fix point <-> polygon code for zero-distance case. "PG_RETURN_FLOAT8(x)" is not "return x", except perhaps by accident on some platforms. http://git.postgresql.org/pg/commitdiff/9418820efb32e739706cc3860347089315562ee4
- Fix file descriptor leak after failure of a \setshell command in pgbench. If the called command fails to return data, runShellCommand forgot to pclose() the pipe before returning. This is fairly harmless in the current code, because pgbench would then abandon further processing of that client thread; so no more than nclients descriptors could be leaked this way. But it's not hard to imagine future improvements whereby that wouldn't be true. In any case, it's sloppy coding, so patch all branches. Found by Coverity. http://git.postgresql.org/pg/commitdiff/d38e8d30cecea96a088330133e232c465a222d0a
- Suppress bogus statistics when pgbench failed to complete any transactions. Code added in 9.4 would attempt to divide by zero in such cases. Noted while testing fix for missing-pclose problem. http://git.postgresql.org/pg/commitdiff/de8e46f5f5785f4016aabf2aa231faa89a0746fb
- Fix off-by-one loop count in MapArrayTypeName, and get rid of static array. MapArrayTypeName would copy up to NAMEDATALEN-1 bytes of the base type name, which of course is wrong: after prepending '_' there is only room for NAMEDATALEN-2 bytes. Aside from being the wrong result, this case would lead to overrunning the statically allocated work buffer. This would be a security bug if the function were ever used outside bootstrap mode, but it isn't, at least not in any currently supported branches. Aside from fixing the off-by-one loop logic, this patch gets rid of the static work buffer by having MapArrayTypeName pstrdup its result; the sole caller was already doing that, so this just requires moving the pstrdup call. This saves a few bytes but mainly it makes the API a lot cleaner. Back-patch on the off chance that there is some third-party code using MapArrayTypeName with less-secure input. Pushing pstrdup into the function should not cause any serious problems for such hypothetical code; at worst there might be a short term memory leak. Per Coverity scanning. http://git.postgresql.org/pg/commitdiff/66709133c7e5506be19bf56a82f45dd150f74732
- Fix poorly worded error message. Adam Brightwell, per report from Martín Marqués. http://git.postgresql.org/pg/commitdiff/c977b8cffc76be00fbaab76e3271e05104260ec7
- Fix another poorly worded error message. Spotted by Álvaro Herrera. http://git.postgresql.org/pg/commitdiff/c340494235111fb87e46b11ca6a87a7a43795f0f
- Allow CHECK constraints to be placed on foreign tables. As with NOT NULL constraints, we consider that such constraints are merely reports of constraints that are being enforced by the remote server (or other underlying storage mechanism). Their only real use is to allow planner optimizations, for example in constraint-exclusion checks. Thus, the code changes here amount to little more than removal of the error that was formerly thrown for applying CHECK to a foreign table. (In passing, do a bit of cleanup of the ALTER FOREIGN TABLE reference page, which had accumulated some weird decisions about ordering etc.) Shigeru Hanada and Etsuro Fujita, reviewed by Kyotaro Horiguchi and Ashutosh Bapat. http://git.postgresql.org/pg/commitdiff/fc2ac1fb41c2defb8caf825781af75db158fb7a9
- Improve hash_create's API for selecting simple-binary-key hash functions. Previously, if you wanted anything besides C-string hash keys, you had to specify a custom hashing function to hash_create(). Nearly all such callers were specifying tag_hash or oid_hash; which is tedious, and rather error-prone, since a caller could easily miss the opportunity to optimize by using hash_uint32 when appropriate. Replace this with a design whereby callers using simple binary-data keys just specify HASH_BLOBS and don't need to mess with specific support functions. hash_create() itself will take care of optimizing when the key size is four bytes. This nets out saving a few hundred bytes of code space, and offers a measurable performance improvement in tidbitmap.c (which was not exploiting the opportunity to use hash_uint32 for its 4-byte keys). There might be some wins elsewhere too, I didn't analyze closely. In future we could look into offering a similar optimized hashing function for 8-byte keys. Under this design that could be done in a centralized and machine-independent fashion, whereas getting it right for keys of platform-dependent sizes would've been notationally painful before. For the moment, the old way still works fine, so as not to break source code compatibility for loadable modules. Eventually we might want to remove tag_hash and friends from the exported API altogether, since there's no real need for them to be explicitly referenced from outside dynahash.c. Teodor Sigaev and Tom Lane http://git.postgresql.org/pg/commitdiff/4a14f13a0abfbf7e7d44a3d2689444d1806aa9dc
- Improve documentation about CASE and constant subexpressions. The possibility that constant subexpressions of a CASE might be evaluated at planning time was touched on in 9.17.1 (CASE expressions), but it really ought to be explained in 4.2.14 (Expression Evaluation Rules) which is the primary discussion of such topics. Add text and an example there, and revise the <note> under CASE to link there. Back-patch to all supported branches, since it's acted like this for a long time (though 9.2+ is probably worse because of its more aggressive use of constant-folding via replanning of nominally-prepared statements). Pre-9.4, also back-patch text added in commit 0ce627d4 about CASE versus aggregate functions. Tom Lane and David Johnston, per discussion of bug #12273. http://git.postgresql.org/pg/commitdiff/5b516835897f2a487eedacdb605ac40d52f6b484
- Docs: clarify treatment of variadic functions with zero variadic arguments. Explain that you have to use "VARIADIC ARRAY[]" to pass an empty array to a variadic parameter position. This was already implicit in the text but it seems better to spell it out. Per a suggestion from David Johnston, though I didn't use his proposed wording. Back-patch to all supported branches. http://git.postgresql.org/pg/commitdiff/699300a146c04e207a8fdec407538cdf5368fde5
Peter Eisentraut a poussé :
- doc: Add link to how to specify time zone names to initdb man page http://git.postgresql.org/pg/commitdiff/6457ff93feca5b798def2c41786904fe13cc41d1
- Translation updates http://git.postgresql.org/pg/commitdiff/ee3bec5e22f7aed4d9086bec45a8d1821a9e236c
- Translation updates http://git.postgresql.org/pg/commitdiff/733a264ddc1ad29d9cb91cbd712c1ef5f92886c8
Heikki Linnakangas a poussé :
- Add point <-> polygon distance operator. Alexander Korotkov, reviewed by Emre Hasegeli. http://git.postgresql.org/pg/commitdiff/4520ba67691fc13bb8be2cc47dd0bf8c7ab94205
- Fix incorrect comment about XLogRecordBlockHeader.data_length field. It does not include the possible full-page image. While at it, reformat the comment slightly to make it more readable. Reported by Rahila Syed http://git.postgresql.org/pg/commitdiff/da9f6a78ef84898ccdf7855089aa08e7524dfbdc
- Misc comment typo fixes. Backpatch the applicable parts, just to make backpatching future patches easier. http://git.postgresql.org/pg/commitdiff/4d65e16a6ff609701a8780d3cddbae02c6e20926
- Clarify the regexp used to detect source files in MSVC builds. The old pattern would match files with strange extensions like *.ry or *.lpp. Refactor it to only include files with known extensions, and to make it more readable. Per Andrew Dunstan's suggestion. http://git.postgresql.org/pg/commitdiff/ce01548d4fdbc06dce59f90a3e4598162b1e8ea1
- Change how first WAL segment on new timeline after promotion is created. Two changes: 1. When copying a WAL segment from old timeline to create the first segment on the new timeline, only copy up to the point where the timeline switch happens, and zero-fill the rest. This avoids corner cases where we might think that the copied WAL from the previous timeline belong to the new timeline. 2. If the timeline switch happens at a segment boundary, don't copy the whole old segment to the new timeline. It's pointless, because it's 100% identical to the old segment. http://git.postgresql.org/pg/commitdiff/ba94518aad23beb800b657bd0cc8c4e7ea43ca33
- Fix timestamp in end-of-recovery WAL records. We used time(null) to set a TimestampTz field, which gave bogus results. Noticed while looking at pg_xlogdump output. Backpatch to 9.3 and above, where the fast promotion was introduced. http://git.postgresql.org/pg/commitdiff/5c805d0a813e6c611485bfc9bde9d2a10d1800e5
- Fix file descriptor leak at end of recovery. XLogFileInit() returns a file descriptor, which needs to be closed. The leak was short-lived, since the startup process exits shortly afterwards, but it was clearly a bug, nevertheless. Per Coverity report. http://git.postgresql.org/pg/commitdiff/2ef6c66a2b1ed288a5e4448989d4b85082d22736
Álvaro Herrera a poussé :
- add missing newline http://git.postgresql.org/pg/commitdiff/4576b9cc46b7a0966b94927b4dcc7d24823cab6a
- Have VACUUM log number of skipped pages due to pins. Author: Jim Nasby, some kibitzing by Heikki Linnankangas. Discussion leading to current behavior and precise wording fueled by thoughts from Robert Haas and Andres Freund. http://git.postgresql.org/pg/commitdiff/35192f0626ccc1729eb6220a5fa04699fd62e04e
- Use %u to print out BlockNumber variables. Per Tom Lane http://git.postgresql.org/pg/commitdiff/cd6e66572b7b5f6bae2b8c8bd62e4862b0a2cf9d
- pg_event_trigger_dropped_objects: add behavior flags. Add "normal" and "original" flags as output columns to the pg_event_trigger_dropped_objects() function. With this it's possible to distinguish which objects, among those listed, need to be explicitely referenced when trying to replicate a deletion. This is necessary so that the list of objects can be pruned to the minimum necessary to replicate the DROP command in a remote server that might have slightly different schema (for instance, TOAST tables and constraints with different names and such.) Catalog version bumped due to change of function definition. Reviewed by: Abhijit Menon-Sen, Stephen Frost, Heikki Linnakangas, Robert Haas. http://git.postgresql.org/pg/commitdiff/0ee98d1cbf1cd3b888633b2ee90e0001889c12b9
Noah Misch a poussé :
- Fix commit_ts test suite for systems with coarse timestamp granularity. Noticed on a couple of Windows configurations. Petr Jelinek, reviewed by Michael Paquier. http://git.postgresql.org/pg/commitdiff/0916eba131530b296f86137759a32f66ffedff7b
- Fix previous commit for TAP test suites in VPATH builds. Per buildfarm member crake. Back-patch to 9.4, where the TAP suites were introduced. http://git.postgresql.org/pg/commitdiff/40c598fa15bef1ea10850aad80914ab797808106
- Recognize Makefile line continuations in fetchRegressOpts(). Back-patch to 9.0 (all supported versions). This is mere future-proofing in the context of the master branch, but commit f6dc6dd5ba54d52c0733aaafc50da2fbaeabb8b0 requires it of older branches. http://git.postgresql.org/pg/commitdiff/43b56171b1fbcba8a6309de755545e3c63ac25dd
- Lock down regression testing temporary clusters on Windows. Use SSPI authentication to allow connections exclusively from the OS user that launched the test suite. This closes on Windows the vulnerability that commit be76a6d39e2832d4b88c0e1cc381aa44a7f86881 closed on other platforms. Users of "make installcheck" or custom test harnesses can run "pg_regress --config-auth=DATADIR" to activate the same authentication configuration that "make check" would use. Back-patch to 9.0 (all supported versions). Security: CVE-2014-0067 http://git.postgresql.org/pg/commitdiff/f6dc6dd5ba54d52c0733aaafc50da2fbaeabb8b0
Andrew Dunstan a poussé :
- Fix some jsonb issues found by Coverity in recent commits. Mostly these issues concern the non-use of function results. These have been changed to use (void) pushJsonbValue(...) instead of assigning the result to a variable that gets overwritten before it is used. There is a larger issue that we should possibly examine the API for pushJsonbValue(), so that instead of returning a value it modifies a state argument. The current idiom is rather clumsy. However, changing that requires quite a bit more work, so this change should do for the moment. http://git.postgresql.org/pg/commitdiff/c8315930e6a34b616d9840985c85eb0d856dd2df
Magnus Hagander a poussé :
- Remove redundant sentence. Spotted by David Johnston http://git.postgresql.org/pg/commitdiff/cb7b5c5c6f8df5fee936c6a26553427166cbdbfe
- Add missing documentation for some vcregress modes. Michael Paquier http://git.postgresql.org/pg/commitdiff/6964ad95d78a21e6d7aec9727ea9a0af68482c35
- Update .gitignore for pg_upgrade. Add Windows versions of generated scripts, and make sure we only ignore the scripts int he root directory. Michael Paquier http://git.postgresql.org/pg/commitdiff/cef0ae498ccbd4b166ee4fe6cb33612646fdc4b5
Andres Freund a poussé :
- Fix (re-)starting from a basebackup taken off a standby after a failure. When starting up from a basebackup taken off a standby extra logic has to be applied to compute the point where the data directory is consistent. Normal base backups use a WAL record for that purpose, but that isn't possible on a standby. That logic had a error check ensuring that the cluster's control file indicates being in recovery. Unfortunately that check was too strict, disregarding the fact that the control file could also indicate that the cluster was shut down while in recovery. That's possible when the a cluster starting from a basebackup is shut down before the backup label has been removed. When everything goes well that's a short window, but when either restore_command or primary_conninfo isn't configured correctly the window can get much wider. That's because inbetween reading and unlinking the label we restore the last checkpoint from WAL which can need additional WAL. To fix simply also allow starting when the control file indicates "shutdown in recovery". There's nicer fixes imaginable, but they'd be more invasive. Backpatch to 9.2 where support for taking basebackups from standbys was added. http://git.postgresql.org/pg/commitdiff/c303e9e7e5d4ddf04526ed8e821ef4b1c3bc2d12
- Adjust valgrind suppression to the changes in 2c03216d8311. CRC computation is now done in XLogRecordAssemble. http://git.postgresql.org/pg/commitdiff/72950dc1d02c6b44c6475485fd5ef8ac277bbdd0
- Define Assert() et al to ((void)0) to avoid pedantic warnings. gcc's -Wempty-body warns about the current usage when compiling postgres without --enable-cassert. http://git.postgresql.org/pg/commitdiff/9959abb0122ca2b0e4817e20954e3083c90becdc
- Prevent potentially hazardous compiler/cpu reordering during lwlock release. In LWLockRelease() (and in 9.4+ LWLockUpdateVar()) we release enqueued waiters using PGSemaphoreUnlock(). As there are other sources of such unlocks backends only wake up if MyProc->lwWaiting is set to false; which is only done in the aforementioned functions. Before this commit there were dangers because the store to lwWaitLink could become visible before the store to lwWaitLink. This could both happen due to compiler reordering (on most compilers) and on some platforms due to the CPU reordering stores. The possible consequence of this is that a backend stops waiting before lwWaitLink is set to NULL. If that backend then tries to acquire another lock and has to wait there the list could become corrupted once the lwWaitLink store is finally performed. Add a write memory barrier to prevent that issue. Unfortunately the barrier support has been only added in 9.2. Given that the issue has not knowingly been observed in praxis it seems sufficient to prohibit compiler reordering using volatile for 9.0 and 9.1. Actual problems due to compiler reordering are more likely anyway. Discussion: 20140210134625.GA15246@awork2.anarazel.de http://git.postgresql.org/pg/commitdiff/37de8de9e33606a043e98fee64b5595aedaa8254
Fujii Masao a poussé :
- Remove odd blank line in comment. Etsuro Fujita http://git.postgresql.org/pg/commitdiff/26674c923d0ecbac2cda039433163d17584fae65
- Update .gitignore for config.cache. Also add a comment about why regreesion.* aren't listed in .gitignore. Jim Nasby http://git.postgresql.org/pg/commitdiff/ccf292cd2ec16c69ddfee3bf72afe113a7595e00
- Ensure variables live across calls in generate_series(numeric, numeric). In generate_series_step_numeric(), the variables "start_num" and "stop_num" may be potentially freed until the next call. So they should be put in the location which can survive across calls. But previously they were not, and which could cause incorrect behavior of generate_series(numeric, numeric). This commit fixes this problem by copying them on multi_call_memory_ctx. Andrew Gierth http://git.postgresql.org/pg/commitdiff/19e065c0492c34fbccbd2c3707ba68cff14195a3
- Add memory barriers for PgBackendStatus.st_changecount protocol. st_changecount protocol needs the memory barriers to ensure that the apparent order of execution is as it desires. Otherwise, for example, the CPU might rearrange the code so that st_changecount is incremented twice before the modification on a machine with weak memory ordering. This surprising result can lead to bugs. This commit introduces the macros to load and store st_changecount with the memory barriers. These are called before and after PgBackendStatus entries are modified or copied into private memory, in order to prevent CPU from reordering PgBackendStatus access. Per discussion on pgsql-hackers, we decided not to back-patch this to 9.4 or before until we get an actual bug report about this. Patch by me. Review by Robert Haas. http://git.postgresql.org/pg/commitdiff/38628db8d8caff21eb6cf8d775c0b2d04cf07b9b
Bruce Momjian a poussé :
- doc: Adjust wording of ALTER TABLESPACE restriction. Report by Noah Misch http://git.postgresql.org/pg/commitdiff/cfb64fde7bb93fb44ebcb1f1924faec5b5705af7
Correctifs rejetés (à ce jour)
- No one was disappointed this week
Correctifs en attente
- Peter Eisentraut sent in another revision of a patch to implement TRANSFORMs.
- Kaigai Kouhei sent in a patch to add ctidscan as an example of the custom scan interface.
- Amit Langote sent in a patch to fix a comment typo in typedef struct BrinTuple.
- Marko (johto) Tiikkaja sent in a patch to add a DROP PRIVILEGES OWNED BY functionality.
- Peter Eisentraut and Michael Paquier traded patches to move the executables from contrib/ to bin/
- Petr (PJMODOS) Jelinek sent in a patch to add a few helper functions for making logical replication easier.
- Petr (PJMODOS) Jelinek sent in another revision of a patch to add a sequence access method.
- Alexander Shulgin sent in another revision of a patch to add an ssl_protocols configuration option.
- Shigeru HANADA sent in a patch to add push-down JOIN support for foreign tables.
- Simon Riggs sent in two revisions of a patch to ensure that logical decoding follows timelines.
- Michael Paquier sent in a patch to document some modes of vcregress.pl that had not previously been documented.
- Michael Paquier sent in a patch to ensure that analyze_new_cluster.bat and delete_old_cluster.bat not be ignored with vcregress upgradecheck.
- Kyotaro HORIGUCHI sent in another revision of a patch to enable asynchronous execution in postgres_fdw.
- Simon Riggs sent in a patch to start WALWriter during recovery and make it responsible for fsyncing data, allowing WALReceiver to progress other useful actions.
- Christoph Berg sent in a patch to fix an unlikely integer overflow.
- Dilip Kumar sent in another revision of a patch to allow parallel cores to be used by vacuumdb.
- Amit Kapila sent in two more revisions of a patch to fix a mismatch between pg_basebackup and Windows.
- Alexander Shulgin sent in a patch to allow a different HINT to be sent to the server error log and to the client, which will be useful where there's security sensitive information that's more appropriate for a HINT than a DETAIL message. Alongside this, he sent a patch to log a hint if pg_ident.conf or pg_hba.conf changed since last reload.
- Heikki Linnakangas sent in four more revisions of a patch to implement a GiST kNN search queue.
- Peter Geoghegan sent in another revision of a patch to implement INSERT ... ON CONFLICT {UPDATE | IGNORE}, and a patch on top of same to fix a bug.
- Adam Brightwell and Álvaro Herrera traded patches to implement a role attribute bitmask catalog representation.
- Tomas Vondra and Ali Akbar traded patches to decrease memory needlessly consumed by array_agg.
- Teodor Sigaev sent in another revision of a patch to add a compress method for SP-GiST.
- Marius Timmer sent in another revision of a patch to display sort order options in VERBOSE mode of EXPLAIN.
- Alexander Shulgin sent in two more revisions of a patch to track TRUNCATE via pgstat.
- Teodor Sigaev and David Rowley traded patches to speed up tidmap by caching pages.
- Michael Paquier sent in four more revisions of a patch to compress full-page writes.
- Teodor Sigaev sent in two more revisions of a patch to speed up tidmap by hashing BlockNumber.
- Simon Riggs sent in another revision of a patch to turn off HOT/Cleanup sometimes.
- Simon Riggs and David Rowley traded patches intended to make it possible to treat aggregates more flexibly, including strategies for parallelizing.
- Tom Lane sent in a patch to make dynahash select normal hash functions.
- Heikki Linnakangas sent in a patch to turn many of the btree_gin macros into real functions.
- Mark Dilger sent in another revision of a patch to allow Oid formatting in printf/elog strings.
- Petr (PJMODOS) Jelinek sent in another revision of a patch to implement TABLESAMPLE.
- Amit Kapila sent in another revision of a patch to implement parallel sequential scan.
- Petr (PJMODOS) Jelinek sent in another revision of a patch to keep track of transaction commit timestamps.
- Heikki Linnakangas sent in a patch to fix an issue with bogus WAL segments archived after promotion by removing the suspect segments at timeline switch.
- Heikki Linnakangas sent in a patch to make WAL archival behave more sensibly in standby mode.
- Álvaro Herrera sent in a patch to distinguish domain constraint from table constraints.
- Robert Haas sent in another revision of a patch to implement parallel mode and parallel contexts.
- Peter Geoghegan sent in a patch to add a new HINT -- a guess as to what column the user might have intended to reference, to be shown in various contexts where an ERRCODE_UNDEFINED_COLUMN error is raised.
- Andrew Dunstan sent in another revision of a patch to fix psql's over-eager use of pagers via a pager_min_lines setting.
- Tatsuo Ishii sent in another revision of a patch to fix an infelicity between pgbench -f and vacuum.
- Michael Paquier sent in a patch to fix some make problems with the addition of test programs to contrib.