PostgreSQL La base de donnees la plus sophistiquee au monde.

La planète francophone de PostgreSQL

vendredi 23 janvier 2015

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 18 janvier 2015

Giulio Calacoci, le principal développeur de Barman, accueillera un rassemblement "Découvrez Barman 1.4.0" à Prato, Italie, le 6 février prochain. Informations complémentaires et inscriptions : http://www.meetup.com/2ndQuadrant-Italia-PostgreSQL-Meetup/events/219801332/

L'appel à conférenciers pour la deuxième conférence suisse de PostgreSQL, devant se tenir à HSR Rapperswil les 25 & 26 juin 2015, est lancé avec, comme date limite, le 1er avril : http://www.postgres-conference.ch/cfp/

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en janvier

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

Stephen Frost a poussé :

  • Skip dead backends in MinimumActiveBackends. Back in ed0b409, PGPROC was split and moved to static variables in procarray.c, with procs in ProcArrayStruct replaced by an array of integers representing process numbers (pgprocnos), with -1 indicating a dead process which has yet to be removed. Access to procArray is generally done under ProcArrayLock and therefore most code does not have to concern itself with -1 entries. However, MinimumActiveBackends intentionally does not take ProcArrayLock, which means it has to be extra careful when accessing procArray. Prior to ed0b409, this was handled by checking for a NULL in the pointer array, but that check was no longer valid after the split. Coverity pointed out that the check could never happen and so it was removed in 5592eba. That didn't make anything worse, but it didn't fix the issue either. The correct fix is to check for pgprocno == -1 and skip over that entry if it is encountered. Back-patch to 9.2, since there can be attempts to access the arrays prior to their start otherwise. Note that the changes prior to 9.4 will look a bit different due to the change in 5592eba. Note that MinimumActiveBackends only returns a bool for heuristic purposes and any pre-array accesses are strictly read-only and so there is no security implication and the lack of fields complaints indicates it's very unlikely to run into issues due to this. Pointed out by Noah Misch. http://git.postgresql.org/pg/commitdiff/1bf4a84d0f9f7a442790d7948e96cd42eeb90a91

Tom Lane a poussé :

  • Use correct text domain for errcontext() appearing within ereport(). The mechanism added in commit dbdf9679d7d61b03a3bf73af9b095831b7010eb5 for associating the correct translation domain with errcontext strings potentially fails in cases where errcontext() is used within an ereport() macro. Such usage was not originally envisioned for errcontext(), but we do have a few places that do it. In this situation, the intended comma expression becomes just a couple of arguments to errfinish(), which the compiler might choose to evaluate right-to-left. Fortunately, in such cases the textdomain for the errcontext string must be the same as for the surrounding ereport. So we can fix this by letting errstart initialize context_domain along with domain; then it will have the correct value no matter which order the calls occur in. (Note that error stack callback functions are not invoked until errfinish, so normal usage of errcontext won't affect what happens for errcontext calls within the ereport macro.) In passing, make sure that errcontext calls within the main backend set context_domain to something non-NULL. This isn't a live bug because NULL would select the current textdomain() setting which should be the right thing anyway --- but it seems better to handle this completely consistently with the regular domain field. Per report from Dmitry Voronin. Backpatch to 9.3; before that, there wasn't any attempt to ensure that errcontext strings were translated in an appropriate domain. http://git.postgresql.org/pg/commitdiff/1f9bf05e539646103c518bcbb49c04919b238f7a
  • Avoid unexpected slowdown in vacuum regression test. I noticed the "vacuum" regression test taking really significantly longer than it used to on a slow machine. Investigation pointed the finger at commit e415b469b33ba328765e39fd62edcd28f30d9c3c, which added creation of an index using an extremely expensive index function. That function was evidently meant to be applied only twice ... but the test re-used an existing test table, which up till a couple lines before that had had over two thousand rows. Depending on timing of the concurrent regression tests, the intervening VACUUMs might have been unable to remove those recently-dead rows, and then the index build would need to create index entries for them too, leading to the wrap_do_analyze() function being executed 2000+ times not twice. Avoid this by using a different table that is guaranteed to have only the intended two rows in it. Back-patch to 9.0, like the commit that created the problem. http://git.postgresql.org/pg/commitdiff/5b3ce2c911a2ec9de13b0dea7e135ad945a14583
  • Fix some functions that were declared static then defined not-static. Per testing with a compiler that whines about this. http://git.postgresql.org/pg/commitdiff/7391e2513f486a5df3eebf132c6dd6c16cf4e1f1
  • Remove duplicate specification of -Ae for HP-UX C compiler. Autoconf has known about automatically selecting -Ae when needed for quite some time now, so remove the redundant addition in template/hpux. Noted while setting up buildfarm member pademelon. http://git.postgresql.org/pg/commitdiff/fd3d894e4ea0021efa2628e4dfc5fe0ed3071859
  • Allow CFLAGS from configure's environment to override automatic CFLAGS. Previously, configure would add any switches that it chose of its own accord to the end of the user-specified CFLAGS string. Since most compilers process these left-to-right, this meant that configure's choices would override the user-specified flags in case of conflicts. We'd rather that worked the other way around, so adjust the logic to put the user's string at the end not the beginning. There does not seem to be a need for a similar behavior change for CPPFLAGS or LDFLAGS: in those, the earlier switches tend to win (think -I or -L behavior) so putting the user's string at the front is fine. Backpatch to 9.4 but not earlier. I'm not planning to run buildfarm member guar on older branches, and it seems a bit risky to change this behavior in long-stable branches. http://git.postgresql.org/pg/commitdiff/85a2a8903f7e9151793308d0638621003aded5ae
  • Improve performance of EXPLAIN with large range tables. As of 9.3, ruleutils.c goes to some lengths to ensure that table and column aliases used in its output are unique. Of course this takes more time than was required before, which in itself isn't fatal. However, EXPLAIN was set up so that recalculation of the unique aliases was repeated for each subexpression printed in a plan. That results in O(N^2) time and memory consumption for large plan trees, which did not happen in older branches. Fortunately, the expensive work is the same across a whole plan tree, so there is no need to repeat it; we can do most of the initialization just once per query and re-use it for each subexpression. This buys back most (not all) of the performance loss since 9.2. We need an extra ExplainState field to hold the precalculated deparse context. That's no problem in HEAD, but in the back branches, expanding sizeof(ExplainState) seems risky because third-party extensions might have local variables of that struct type. So, in 9.4 and 9.3, introduce an auxiliary struct to keep sizeof(ExplainState) the same. We should refactor the APIs to avoid such local variables in future, but that's material for a separate HEAD-only commit. Per gripe from Alexey Bashtanov. Back-patch to 9.3 where the issue was introduced. http://git.postgresql.org/pg/commitdiff/a5cd70dcbc268381e13cb0b2973b5732856d186f
  • Rearrange explain.c's API so callers need not embed sizeof(ExplainState). The folly of the previous arrangement was just demonstrated: there's no convenient way to add fields to ExplainState without breaking ABI, even if callers have no need to touch those fields. Since we might well need to do that again someday in back branches, let's change things so that only explain.c has to have sizeof(ExplainState) compiled into it. This costs one extra palloc() per EXPLAIN operation, which is surely pretty negligible. http://git.postgresql.org/pg/commitdiff/8e166e164c7c4531d7eb150d836aa2357989237a
  • Fix use-of-already-freed-memory problem in EvalPlanQual processing. Up to now, the "child" executor state trees generated for EvalPlanQual rechecks have simply shared the ResultRelInfo arrays used for the original execution tree. However, this leads to dangling-pointer problems, because ExecInitModifyTable() is all too willing to scribble on some fields of the ResultRelInfo(s) even when it's being run in one of those child trees. This trashes those fields from the perspective of the parent tree, because even if the generated subtree is logically identical to what was in use in the parent, it's in a memory context that will go away when we're done with the child state tree. We do however want to share information in the direction from the parent down to the children; in particular, fields such as es_instrument *must* be shared or we'll lose the stats arising from execution of the children. So the simplest fix is to make a copy of the parent's ResultRelInfo array, but not copy any fields back at end of child execution. Per report from Manuel Kniep. The added isolation test is based on his example. In an unpatched memory-clobber-enabled build it will reliably fail with "ctid is NULL" errors in all branches back to 9.1, as a consequence of junkfilter->jf_junkAttNo being overwritten with $7f7f. This test cannot be run as-is before that for lack of WITH syntax; but I have no doubt that some variant of this problem can arise in older branches, so apply the code change all the way back. http://git.postgresql.org/pg/commitdiff/c480cb9d246cec5e1dd7d72956e792df16e5445d
  • Improve new caching logic in tbm_add_tuples(). For no significant extra complexity, we can cache knowledge that the target page is lossy, and save a hash_search per iteration in that case as well. This probably makes little difference, since the extra rechecks that must occur when pages are lossy are way more expensive than anything we can save here ... but we might as well do it if we're going to cache anything. http://git.postgresql.org/pg/commitdiff/779fdcdeeeb9cdbfd271f8dc5bde76ed0c7b0813
  • Show sort ordering options in EXPLAIN output. Up to now, EXPLAIN has contented itself with printing the sort expressions in a Sort or Merge Append plan node. This patch improves that by annotating the sort keys with COLLATE, DESC, USING, and/or NULLS FIRST/LAST whenever nondefault sort ordering options are used. The output is now a reasonably close approximation of an ORDER BY clause equivalent to the plan's ordering. Marius Timmer, Lukas Kreft, and Arne Scheffer; reviewed by Mike Blackwell. Some additional hacking by me. http://git.postgresql.org/pg/commitdiff/20af53d7191f84d0f5b86da4362e481b7e85d52a
  • Fix ancient thinko in default table rowcount estimation. The code used sizeof(ItemPointerData) where sizeof(ItemIdData) is correct, since we're trying to account for a tuple's line pointer. Spotted by Tomonari Katsumata (bug #12584). Although this mistake is of very long standing, no back-patch, since it's a relatively harmless error and changing it would risk changing default planner behavior in stable branches. (I don't see any change in regression test outputs here, but the buildfarm may think differently.) http://git.postgresql.org/pg/commitdiff/75df6dc083f7a989697b5002a421fb204f2eeddb

Alvaro Herrera a poussé :

Heikki Linnakangas a poussé :

  • Fix typos in comment. Plus some tiny wordsmithing of not-quite-typos. http://git.postgresql.org/pg/commitdiff/3dfce37627b76e4da9e1d6090beedb608cefafcb
  • Silence Coverity warnings about unused return values from pushJsonbValue(). Similar warnings from backend were silenced earlier by commit c8315930, but there were a few more contrib/hstore. Michael Paquier http://git.postgresql.org/pg/commitdiff/e37d474f91c3a8a88be28a65389c948a55f18075
  • Fix thinko in re-setting wal_log_hints flag from a parameter-change record. The flag is supposed to be copied from the record. Same issue with track_commit_timestamps, but that's master-only. Report and fix by Petr Jalinek. Backpatch to 9.4, where wal_log_hints was added. http://git.postgresql.org/pg/commitdiff/49b04188f83fb8cacf925978989bc20399e76786
  • Another attempt at fixing Windows Norwegian locale. Previous fix mapped "Norwegian (BokmÃ¥l)" locale, which contains a non-ASCII character, to the pure ASCII alias "norwegian-bokmal". However, it turns out that more recent versions of the CRT library, in particular MSVCR110 (Visual Studio 2012), changed the behaviour of setlocale() so that if you pass "norwegian-bokmal" to setlocale, it returns "Norwegian_Norway". That meant trouble, when setlocale(..., NULL) first returned "Norwegian (BokmÃ¥l)_Norway", which we mapped to "norwegian-bokmal_Norway", but another call to setlocale(..., "norwegian-bokmal_Norway") returned "Norwegian_Norway". That caused PostgreSQL to think that they are different locales, and therefore not compatible. That caused initdb to fail at CREATE DATABASE. Older CRT versions seem to accept "Norwegian_Norway" too, so change the mapping to return "Norwegian_Norway" instead of "norwegian-bokmal". Backpatch to 9.2 like the previous attempt. We haven't made a release that includes the previous fix yet, so we don't need to worry about changing the locale of existing clusters from "norwegian-bokmal" to "Norwegian_Norway". (Doing any mapping like this at all requires changing the locale of existing databases; the release notes need to include instructions for that). http://git.postgresql.org/pg/commitdiff/aa1d2fc5e91e396bec5bf8a8d10b6cc4af0b0fff
  • Advance backend's advertised xmin more aggressively. Currently, a backend will reset it's PGXACT->xmin value when it doesn't have any registered snapshots left. That covered the common case that a transaction in read committed mode runs several queries, one after each other, as there would be no snapshots active between those queries. However, if you hold cursors across each of the query, we didn't get a chance to reset xmin. To make that better, keep all the registered snapshots in a pairing heap, ordered by xmin so that it's always quick to find the snapshot with the smallest xmin. That allows us to advance PGXACT->xmin whenever the oldest snapshot is deregistered, even if there are others still active. Per discussion originally started by Jeff Davis back in 2009 and more recently by Robert Haas. http://git.postgresql.org/pg/commitdiff/94028691609f8e148bd4ce72c46163f018832a5b

Andres Freund a poussé :

  • Allow latches to wait for socket writability without waiting for readability. So far WaitLatchOrSocket() required to pass in WL_SOCKET_READABLE as that solely was used to indicate error conditions, like EOF. Waiting for WL_SOCKET_WRITEABLE would have meant to busy wait upon socket errors. Adjust the API to signal errors by returning the socket as readable, writable or both, depending on WL_SOCKET_READABLE/WL_SOCKET_WRITEABLE being specified. It would arguably be nicer to return WL_SOCKET_ERROR but that's not possible on platforms and would probably also result in more complex callsites. This previously had explicitly been forbidden in e42a21b9e6c9, as there was no strong use case at that point. We now are looking into making FE/BE communication use latches, so changing this makes sense. There also are some portability concerns because there cases of older platforms where select(2) is known to, in violation of POSIX, not return a socket as writable after the peer has closed it. So far the platforms where that's the case provide a working poll(2). If we find one where that's not the case, we'll need to add a workaround for that platform. Discussion: 20140927191243.GD5423@alap3.anarazel.de Reviewed-By: Heikki Linnakangas, Noah Misch http://git.postgresql.org/pg/commitdiff/4bad60e3fd9a5fc6070fd4d1bd820a280e174654
  • Add barriers to the latch code. Since their introduction latches have required barriers in SetLatch and ResetLatch - but when they were introduced there wasn't any barrier abstraction. Instead latches were documented to rely on the callsites to provide barrier semantics. Now that the barrier support looks halfway complete, add the necessary barriers to both latch implementations. Also remove a now superflous lock acquisition from syncrep.c and a superflous (and insufficient) barrier from freelist.c. There might be other cases that can now be simplified, but those are the only ones I've seen on a quick scan. We might want to backpatch this at some later point, but right now the barrier infrastructure in the backbranches isn't totally on par with master. Discussion: 20150112154026.GB2092@awork2.anarazel.de http://git.postgresql.org/pg/commitdiff/14e8803f101a54d99600683543b0f893a2e3f529
  • Remove some dead IsUnderPostmaster code from bootstrap.c. Since commit 626eb021988a2 has introduced the auxiliary process infrastructure, bootstrap_signals() was never used when forked from postmaster. Remove the IsUnderPostmaster specific code, and add a appropriate assertion. http://git.postgresql.org/pg/commitdiff/0139dea8f1cea49f13c22a3f645dbdd02b90d25c
  • Commonalize process startup code. Move common code, that was duplicated in every postmaster child/every standalone process, into two functions in miscinit.c. Not only does that already result in a fair amount of net code reduction but it also makes it much easier to remove more duplication in the future. The prime motivation wasn't code deduplication though, but easier addition of new common code. http://git.postgresql.org/pg/commitdiff/31c453165b5a656044ce1dbce89f5828c1c7e23c
  • Make logging_collector=on work with non-windows EXEC_BACKEND again. Commit b94ce6e80 reordered postmaster's startup sequence so that the tempfile directory is only cleaned up after all the necessary state for pg_ctl is collected. Unfortunately the chosen location is after the syslogger has been started; which normally is fine, except for !WIN32 EXEC_BACKEND builds, which pass information to children via files in the temp directory. Move the call to RemovePgTempFiles() to just before the syslogger has started. That's the first child we fork. Luckily EXEC_BACKEND is pretty much only used by endusers on windows, which has a separate method to pass information to children. That means the real world impact of this bug is very small. Discussion: 20150113182344.GF12272@alap3.anarazel.de Backpatch to 9.1, just as the previous commit was. http://git.postgresql.org/pg/commitdiff/2be82dcf17a18511df5153bcafe67a9c1387be1e
  • Add a default local latch for use in signal handlers. To do so, move InitializeLatchSupport() into the new common process initialization functions, and add a new global variable MyLatch. MyLatch is usable as soon InitPostmasterChild() has been called (i.e. very early during startup). Initially it points to a process local latch that exists in all processes. InitProcess/InitAuxiliaryProcess then replaces that local latch with PGPROC->procLatch. During shutdown the reverse happens. This is primarily advantageous for two reasons: For one it simplifies dealing with the shared process latch, especially in signal handlers, because instead of having to check for MyProc, MyLatch can be used unconditionally. For another, a later patch that makes FEs/BE communication use latches, now can rely on the existence of a latch, even before having gone through InitProcess. Discussion: 20140927191243.GD5423@alap3.anarazel.de http://git.postgresql.org/pg/commitdiff/59f71a0d0b56b2df48db4bf1738aece5551f7a47
  • Blindly try to fix a warning in s_lock.h when compiling with gcc on HPPA. The possibly, depending on compiler settings, generated warning was "warning: `S_UNLOCK' redefined". The hppa spinlock implementation doesn't follow the rules of s_lock.h and provides a gcc specific implementation outside of the the part of the file that's supposed to do that. It does so to avoid duplication between the HP compiler and gcc. That unfortunately means that S_UNLOCK is already defined when the HPPA specific section is reached. Undefine the generic fallback S_UNLOCK definition inside the HPPA section. That's far from pretty, but has the big advantage of being simple. If somebody is interested to fix this in a prettier way... This presumably got broken in the course of 0709b7ee72. Discussion: 20150114225919.GY5245@awork2.anarazel.de Per complaint from Tom Lane. http://git.postgresql.org/pg/commitdiff/6cfd5086e140b365086d61f25c519d046dfcf7f0
  • Make tbm_add_tuples more efficient by caching the last acccessed page. When adding a large number of tuples to a TID bitmap using tbm_add_tuples() sometimes a lot of time was spent looking up a page's entry in the bitmap's internal hashtable. Improve efficiency by caching the last accessed page, while iterating over the passed in tuples, hoping consecutive tuples will often be on the same page. In many cases that's a good bet, and in the rest the added overhead isn't big. Discussion: 54479A85.8060309@sigaev.ru Author: Teodor Sigaev Reviewed-By: David Rowley http://git.postgresql.org/pg/commitdiff/f5ae3ba4828ece02bae2d16b4cbce847fbcea850
  • Replace walsender's latch with the general shared latch. Relying on the normal shared latch simplifies interrupt/signal handling because we can rely on all signal handlers setting the proc latch. That in turn allows us to avoid the use of ImmediateInterruptOK, which arguably isn't correct because WaitLatchOrSocket isn't declared to be immediately interruptible. Also change sections that wait on the walsender's latch to notice interrupts quicker/more reliably and make them more consistent with each other. This is part of a larger "get rid of ImmediateInterruptOK" series. Discussion: 20150115020335.GZ5245@awork2.anarazel.de http://git.postgresql.org/pg/commitdiff/ff44fba46c09c37dd9e60da1cb0b3a9339eb085f
  • Fix use of already freed memory when dumping a database's security label. pg_dump.c:dumDatabase() called ArchiveEntry() with the results of a a query that was PQclear()ed a couple lines earlier. Backpatch to 9.2 where security labels for shared objects where introduced. http://git.postgresql.org/pg/commitdiff/525b84c576e119de7f2b0d00e3a99d559771aa7b

Robert Haas a poussé :

Noah Misch a poussé :

Peter Eisentraut a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Michael Paquier sent in three revisions of a patch to remove unused variables in hstore_to_jsonb.
  • Petr (PJMODOS) Jelinek sent in another revision of a patch to implement a sequence access method.
  • Dean Rasheed sent in three more revisions of a patch to fix some infelicities between INSERT...ON CONFLICT and RLS.
  • Michael Paquier sent in two more revisions of a patch to implement table-level log_autovacuum_min_duration.
  • Michael Paquier sent in two revisions of a patch to create non-erroring memory allocation functions.
  • Michael Paquier sent in a patch to fix a memory leak in receivelog.c when receiving stream.
  • Ali Akbar sent in a patch to clarify documentation that made generate_series(numeric, numeric) harder to implement.
  • Oskari Saarenmaa sent in a patch to defines custom macros for each attribute and enables them individually for compilers that support them and never defines __attribute__.
  • Andreas Karlsson and Michael Paquier traded patches to reduce the needed lock strength of triggers and foreign key DDL.
  • Marco Nenciarini sent in two more revisions of a patch to implement incremental backup.
  • Kyotaro HORIGUCHI sent in three more revisions of a patch to allow async execution of the PostgreSQL FDW.
  • Tomas Vondra sent in another revision of a patch to reduce the amount of memory consumed by array_agg().
  • Michael Paquier sent in a patch to make mere absence of destination folders not be a failure mode.
  • Etsuro Fujita sent in a patch to fix an issue where EvalPlanQual behaves oddly for FDW queries involving system columns.
  • Heikki Linnakangas sent in two more revisions of a patch to add pg_rewind.
  • Adam Brightwell sent in a patch to add some additional role attributes.
  • Amit Langote sent in a patch to fix a typo in brin.c.
  • Dilip Kumar sent in another revision of a patch to allow vacuumdb to work in parallel.
  • Gilles Darold sent in a patch to fix an issue in pg_dump with unusally-named tables.
  • Robert Haas sent in another revision of a patch to implement parallel mode and parallel contexts.
  • Michael Paquier sent in two revisions of a patch to fix a situation where the error check always bypassed in tablefunc.c.
  • Alexander Korotkov sent in two more revisions of a patch to implement fillfactor for GIN indexes.
  • Andres Freund sent in a patch to fix various shortcomings of the new PrivateRefCount infrastructure.
  • Pavel Stehule sent in a patch to add an array_position() function to PL/pgsql.
  • Andres Freund and Michael Paquier traded patches to move binaries from contrib/ to bin/
  • Pavel Stehule sent in a patch to complete the deprecation of => for other than pair-like functionality.
  • Tom Lane sent in a patch to deal with pg_stat wait timeout.
  • Tom Lane sent in a patch to have the buildfarm clean up temporary installs when done.
  • Michael Paquier sent in another revision of a patch to add recovery_timeout option to control timeout of restore_command nonzero status code.

par N Bougain le vendredi 23 janvier 2015 à 00h53

Nouvelles hebdomadaires de PostgreSQL - 11 janvier 2015

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en janvier

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

Fujii Masao a poussé :

Andres Freund a poussé :

  • Fix oversight in recent pg_basebackup fix causing pg_receivexlog failures. A oversight in 2c0a485896 causes 'could not create archive status file "...": No such file or directory' errors in pg_receivexlog if the target directory doesn't happen to contain a arch aAS FM SM tatus directory. That's due to a stupidly left over 'true' constant instead of mark_done being passed down to ProcessXLogDataMsg(). The bug is only present in the master branch, and luckily wasn't released. Spotted by Fujii Masao. http://git.postgresql.org/pg/commitdiff/3c9e4cdbf2ec876dbb71aa80a4cc18662fbd41c2
  • Correctly handle relcache invalidation corner case during logical decoding. When using a historic snapshot for logical decoding it can validly happen that a relation that's in the relcache isn't visible to that historic snapshot. E.g. if a newly created relation is referenced in the query that uses the SQL interface for logical decoding and a sinval reset occurs. The earlier commit that fixed the error handling for that corner case already improves the situation as a ERROR is better than hitting an assertion... But it's obviously not good enough. So additionally allow that case without an error if a historic snapshot is set up - that won't allow an invalid entry to stay in the cache because it's a) already marked invalid and will thus be rebuilt during the next access b) the syscaches will be reset at the end of decoding. There might be prettier solutions to handle this case, but all that we could think of so far end up being much more complex than this quite simple fix. This fixes the assertion failures reported by the buildfarm (markhor, tick, leech) after the introduction of new regression tests in 89fd41b390a4. The failure there weren't actually directly caused by CLOBBER_CACHE_ALWAYS but the extraordinary long runtimes due to it lead to sinval resets triggering the behaviour. Discussion: 22459.1418656530@sss.pgh.pa.us Backpatch to 9.4 where logical decoding was introduced. http://git.postgresql.org/pg/commitdiff/3fabed070530271771c2345dd7f60b0b28f0aae3
  • Improve relcache invalidation handling of currently invisible relations. The corner case where a relcache invalidation tried to rebuild the entry for a referenced relation but couldn't find it in the catalog wasn't correct. The code tried to RelationCacheDelete/RelationDestroyRelation the entry. That didn't work when assertions are enabled because the latter contains an assertion ensuring the refcount is zero. It's also more generally a bad idea, because by virtue of being referenced somebody might actually look at the entry, which is possible if the error is trapped and handled via a subtransaction abort. Instead just error out, without deleting the entry. As the entry is marked invalid, the worst that can happen is that the invalid (and at some point unused) entry lingers in the relcache. Discussion: 22459.1418656530@sss.pgh.pa.us There should be no way to hit this case < 9.4 where logical decoding introduced a bug that can hit this. But since the code for handling the corner case is there it should do something halfway sane, so backpatch all the the way back. The logical decoding bug will be handled in a separate commit. http://git.postgresql.org/pg/commitdiff/31912d01d8d860ffaafb386437d149e1749962ab
  • Remove comment that was intended to have been removed before commit. Noticed by Amit Kapila http://git.postgresql.org/pg/commitdiff/f454144a34c2288418292ae7b01495724cfda359
  • Move comment about sun cc's __machine_rw_barrier being a full barrier. I'd accidentally written the comment besides the read barrier, instead of the full barrier, implementation. Noticed by Oskari Saarenmaa http://git.postgresql.org/pg/commitdiff/93be0950070b5bcb22600cb1cbb62f93c058a5dd
  • Fix logging of pages skipped due to pins during vacuum. The new logging introduced in 35192f06 made the incorrect assumption that scan_all vacuums would always wait for buffer pins; but they only do so if the page actually needs to be frozen. Fix that inaccuracy by removing the difference in log output based on scan_all and just always remove the same message. I chose to keep the split log message from the original commit for now, it seems likely that it'll be of use in the future. Also merge the line about buffer pins in autovacuum's log output into the existing "pages: ..." line. It seems odd to have a separate line about pins, without the "topic: " prefix others have. Also rename the new 'pinned_pages' variable to 'pinskipped_pages' because it actually tracks the number of pages that could *not* be pinned. Discussion: 20150104005324.GC9626@awork2.anarazel.de http://git.postgresql.org/pg/commitdiff/17eaae9897781c6dcc622b9327899329e4d2a4df
  • Fix alignment of pg_atomic_uint64 variables on some 32bit platforms. I failed to recognize that pg_atomic_uint64 wasn't guaranteed to be 8 byte aligned on some 32bit platforms - which it has to be on some platforms to guarantee the desired atomicity and which we assert. As this is all compiler specific code anyway we can just rely on compiler specific tricks to enforce alignment. I've been unable to find concrete documentation about the version that introduce the sunpro alignment support, so that might need additional guards. I've verified that this works with gcc x86 32bit, but I don't have access to any other 32bit environment. Discussion: op.xpsjdkil0sbe7t@vld-kuci. Per report from Vladimir Koković. http://git.postgresql.org/pg/commitdiff/db4ec2ffce3549225619cae51d828224a11a165f
  • Provide a generic fallback for pg_compiler_barrier using an extern function. If the compiler/arch combination does not provide compiler barriers, provide a fallback. That fallback simply consists out of a function call into a externally defined function. That should guarantee compiler barrierer semantics except for compilers that do inter translation unit/global optimization - those better provide an actual compiler barrier. Hopefully this fixes Tom's report of linker failures due to pg_compiler_barrier_impl not being provided. I'm not backpatching this commit as it builds on the new atomics infrastructure. If we decide an equivalent fix needs to be backpatched, I'll do so in a separate commit. Discussion: 27746.1420930690@sss.pgh.pa.us. Per report from Tom Lane. http://git.postgresql.org/pg/commitdiff/de6429a8fdd3538e977b482d90389785d733e373

Tom Lane a poussé :

  • Fix broken pg_dump code for dumping comments on event triggers. This never worked, I think. Per report from Marc Munro. In passing, fix funny spacing in the COMMENT ON command as a result of excess space in the "label" string. http://git.postgresql.org/pg/commitdiff/adfc157dd91471e995f3aa72e0fb5b50ecd93575
  • Fix libpq's behavior when /etc/passwd isn't readable. Some users run their applications in chroot environments that lack an /etc/passwd file. This means that the current UID's user name and home directory are not obtainable. libpq used to be all right with that, so long as the database role name to use was specified explicitly. But commit a4c8f14364c27508233f8a31ac4b10a4c90235a9 broke such cases by causing any failure of pg_fe_getauthname() to be treated as a hard error. In any case it did little to advance its nominal goal of causing errors in pg_fe_getauthname() to be reported better. So revert that and instead put some real error-reporting code in place. This requires changes to the APIs of pg_fe_getauthname() and pqGetpwuid(), since the latter had departed from the POSIX-specified API of getpwuid_r() in a way that made it impossible to distinguish actual lookup errors from "no such user". To allow such failures to be reported, while not failing if the caller supplies a role name, add a second call of pg_fe_getauthname() in connectOptions2(). This is a tad ugly, and could perhaps be avoided with some refactoring of PQsetdbLogin(), but I'll leave that idea for later. (Note that the complained-of misbehavior only occurs in PQsetdbLogin, not when using the PQconnect functions, because in the latter we will never bother to call pg_fe_getauthname() if the user gives a role name.) In passing also clean up the Windows-side usage of GetUserName(): the recommended buffer size is 257 bytes, the passed buffer length should be the buffer size not buffer size less 1, and any error is reported by GetLastError() not errno. Per report from Christoph Berg. Back-patch to 9.4 where the chroot failure case was introduced. The generally poor reporting of errors here is of very long standing, of course, but given the lack of field complaints about it we won't risk changing these APIs further back (even though they're theoretically internal to libpq). http://git.postgresql.org/pg/commitdiff/080eabe2e8a184ff40b7380aaaa9418714acace9
  • Remove configure test for nonstandard variants of getpwuid_r(). We had code that supposed that some platforms might offer a nonstandard version of getpwuid_r() with only four arguments. However, the 5-argument definition has been standardized at least since the Single Unix Spec v2, which is our normal reference for what's portable across all Unix-oid platforms. (What's more, this wasn't the only pre-standardization version of getpwuid_r(); my old HPUX 10.20 box has still another signature.) So let's just get rid of the now-useless configure step. http://git.postgresql.org/pg/commitdiff/8883bae33b55a52105b1b58d0e42c5a6bda09627
  • Fix portability breakage in pg_dump. Commit 0eea8047bf0e15b402b951e383e39236bdfe57d5 introduced some overly optimistic assumptions about what could be in a local struct variable's initializer. (This might in fact be valid code according to C99, but I've got at least one pre-C99 compiler that falls over on those nonconstant address expressions.) There is no reason whatsoever for main()'s workspace to not be static, so revert long_options[] to a static and make the DumpOptions struct static as well. http://git.postgresql.org/pg/commitdiff/44096f1c6644a97c92da6c96dc1d8d4e200d4a38

Bruce Momjian a poussé :

Ãlvaro Herrera a poussé :

Peter Eisentraut a poussé :

  • Fix namespace handling in xpath function. Previously, the xml value resulting from an xpath query would not have namespace declarations if the namespace declarations were attached to an ancestor element in the input xml value. That means the output value was not correct XML. Fix that by running the result value through xmlCopyNode(), which produces the correct namespace declarations. Author: Ali Akbar <the.apaan@gmail.com> http://git.postgresql.org/pg/commitdiff/79af9a1d2668c9edc8171f03c39e7fed571eeb98

Heikki Linnakangas a poussé :

  • Don't open a WAL segment for writing at end of recovery. Since commit ba94518a, we used XLogFileOpen to open the next segment for writing, but if the end-of-recovery happens exactly at a segment boundary, the new segment might not exist yet. (Before ba94518a, XLogFileOpen was correct, because we would open the previous segment if the switch happened at the boundary.) Instead of trying to create it if necessary, it's simpler to not bother opening the segment at all. XLogWrite() will open or create it soon anyway, after writing the checkpoint or end-of-recovery record. Reported by Andres Freund. http://git.postgresql.org/pg/commitdiff/1e78d81e883d7987de8da559d985958335820cc8

Robert Haas a poussé :

Noah Misch a poussé :

  • On Darwin, refuse postmaster startup when multithreaded. The previous commit introduced its report at LOG level to avoid surprises at minor release upgrade time. Compel users deploying the next major release to also deploy the reported workaround. http://git.postgresql.org/pg/commitdiff/2048e5b88198213ae15c4b59ddbe124f1a5dc2b7
  • Always set the six locale category environment variables in main(). Typical server invocations already achieved that. Invalid locale settings in the initial postmaster environment interfered, as could malloc() failure. Setting "LC_MESSAGES=pt_BR.utf8 LC_ALL=invalid" in the postmaster environment will now choose C-locale messages, not Brazilian Portuguese messages. Most localized programs, including all PostgreSQL frontend executables, do likewise. Users are unlikely to observe changes involving locale categories other than LC_MESSAGES. CheckMyDatabase() ensures that we successfully set LC_COLLATE and LC_CTYPE; main() sets the remaining three categories to locale "C", which almost cannot fail. Back-patch to 9.0 (all supported versions). http://git.postgresql.org/pg/commitdiff/6fdba8ceb071a3512d5685f1cd4f971ab4d562d1
  • Reject ANALYZE commands during VACUUM FULL or another ANALYZE. vacuum()'s static variable handling makes it non-reentrant; an ensuing null pointer deference crashed the backend. Back-patch to 9.0 (all supported versions). http://git.postgresql.org/pg/commitdiff/e415b469b33ba328765e39fd62edcd28f30d9c3c
  • On Darwin, detect and report a multithreaded postmaster. Darwin --enable-nls builds use a substitute setlocale() that may start a thread. Buildfarm member orangutan experienced BackendList corruption on account of different postmaster threads executing signal handlers simultaneously. Furthermore, a multithreaded postmaster risks undefined behavior from sigprocmask() and fork(). Emit LOG messages about the problem and its workaround. Back-patch to 9.0 (all supported versions). http://git.postgresql.org/pg/commitdiff/894459e59ffa5c7fee297b246c17e1f72564db1d

Stephen Frost a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Michael Paquier sent in a patch to complain about OOM of XLOG reader allocation in logical decoding code.
  • Andres Freund sent in a patch to improve handling of relcache invalidations to currently invisible relations.
  • Petr (PJMODOS) Jelinek sent in two revisions of a patch to fix handlign of event triggers in pg_dump.
  • Michael Paquier sent in a patch to add a restore_command_retry_interval to control retries of restore_command.
  • Fabien COELHO sent in two more revisions of a patch to add modulo (%) to pg_bench.
  • Petr (PJMODOS) Jelinek sent in two more revisions of a patch to track commit timestamps.
  • Atri Sharma sent in a patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs.
  • Heikki Linnakangas sent in three more revisions of a patch to add pg_rewind.
  • Michael Paquier sent in two more revisions of a patch to add compression of full-page writes.
  • Kaigai Kouhei sent in another revision of a patch to add ctid scans as an example of the custom scan interface.
  • Andrew (RhodiumToad) Gierth sent in another revision of a patch to add GROUPING SETS.
  • Andrew Dunstan sent in a patch to add min and max execute statement time in pg_stat_statement.
  • Petr (PJMODOS) Jelinek sent in a patch to bring XLOG_PARAMETER_CHANGE into line with the new handling of wal_log_hints.
  • Robert Haas sent in two more revisions of a patch to implement parallel mode and parallel contexts.
  • Peter Eisentraut sent in another revision of a patch to turn recovery.conf into GUCs.
  • Kaigai Kouhei sent in another revision of a patch to implement a custom and foreign join interface.
  • Marius Timmer sent in another revision of a patch to add sort order to EXPLAIN output.
  • Tomas Vondra sent in another revision of a patch to do better memory accounting for memory-bounded hashaggs, another to do the aforementioned hashaggs, and a third to change hashcontext to aggcontext where needed.
  • Michael Paquier and Alexander Korotkov traded patches to add a fillfactor for GIN indexes.
  • Marco Nenciarini sent in a patch to implement a LSN map, one of whose outcomes will likely be incremental backup.
  • Craig Ringer sent in a patch to make server_version_num a GUC_REPORT.
  • Dean Rasheed sent in a patch to fix the documentation for CREATE POLICY.
  • Aaron Botsis sent in another revision of a patch to allow parsing JSON with embedded double quotes.
  • Petr (PJMODOS) Jelinek sent in two more revisions of a patch to implement TABLESAMPLE.
  • David Fetter sent in three more revisions of a patch to fix psql's mis-handling of connect string and URI parameters with \c[onnect].
  • Tomas Vondra and Ali Akbar traded patches to decrease the memory needed for array_agg().
  • David Rowley sent in another revision of a patch to allow removing INNER JOINs under some circumstances.
  • Amit Kapila sent in another revision of a patch to enable parallel sequential scans.
  • Kyotaro HORIGUCHI sent in another revision of a patch to allow asynchronous execution of postgres_fdw.
  • Abhijit Menon-Sen sent in another revision of a patch set to do better CRCs, depending on availability.
  • Dean Rasheed sent in a patch to improve RLS qual pushdowns by checking whether leakage is significant in direct terms like row contents.
  • Bruce Momjian sent in a patch to make PQputCopyEnd adhere to its API contract.
  • Andres Freund sent in a flock of patches intended to fix an issue that originally manifested as inability to escape from a blocked send().
  • Peter Geoghegan sent in another revision of a patch to implement INSERT ... ON CONFLICT {UPDATE | IGNORE}.

par N Bougain le vendredi 23 janvier 2015 à 00h36

mercredi 21 janvier 2015

Guillaume Lelarge

PostgreSQL - Architecture et notions avancées

Et voilà, j'ai fini par le faire. J'ai fini par me convaincre d'écrire un livre complet sur PostgreSQL.

C'est quelque chose qui me trottait dans la tête depuis longtemps. Surtout depuis que Thomas Reiss m'avait montré le Concept Guide d'Oracle. Je m'étais dit à ce moment-là : mince, c'est ça qu'il manque à PostgreSQL. Mais bon, ça demande beaucoup de temps, beaucoup de travail. Je n'avais pas très envie de me jeter là-dedans, même si je savais que certains éditeurs cherchaient des auteurs pour des livres sur PostgreSQL.

J'ai eu la chance de connaître Patricia Montcorgé lors de la traduction du livre de Greg Smith sur les performances avec PostgreSQL. Si bien que, après avoir lu le livre de Brendan Gregg sur la recherche de performances (Systems Performance: Enterprise and the Cloud, excellent livre, à mettre entre toutes les mains), je lui ai proposé deux projets : la traduction de ce livre et l'écriture d'un livre sur PostgreSQL. Elle m'a appris qu'elle avait fondé sa propre maison d'édition, qu'elle ne s'occupait plus de traductions, et que le livre sur PostgreSQL pourrait l'intéresser. On s'est rencontré, et, après lui avoir expliqué plus en profondeur mon projet, elle a pu m'expliquer comment elle voyait le travail avec elle. J'ai trouvé que ça ressemblait beaucoup à un projet libre, avec une version beta, du git, du docbook, des mises à jour facile, etc. Bref, j'étais bien accroché.

Je travaille sur ce livre depuis avril 2014. On a déjà subi un gros retard à cause du chapitre sur les processus : étudier le code de chaque processus a été particulièrement long. Mais bon, on a maintenant un rythme de croisière intéressant. On s'est décidé sur un chapitre tous les 4 à 6 semaines.

La version beta est sortie aujourd'hui. Elle est disponible par module ou complète, uniquement en version électronique pour le moment (jusqu'à la version finale en fait). Les chapitres seront livrés au fur et à mesure de leur écriture. Un forum est disponible pour les lecteurs qui voudraient laisser des commentaires ou des demandes ou des corrections.

La version finale sera mise à jour pour intégrer les changements effectués par la version 9.5.

Bon, je retourne bosser sur le livre :)

Preneur de tout commentaire par mail sur guillaume@lelarge.info.

par Guillaume Lelarge le mercredi 21 janvier 2015 à 22h50

mardi 6 janvier 2015

Damien Clochard

Rendez-vous au FOSDEM 2015 !

Dalibo prendra part au FOSDEM 2015, évènement rassemblant plus de 5000 participants du monde entier, et qui se tiendra à Bruxelles, du 31 janvier au 1er février 2015.

Le FOSDEM est un évènement libre qui offre aux communautés open source un lieu de rencontre, d’échanges et de collaborations et le FOSDEM PG Day est une journée organisée par PostgreSQL Europe, en amont de ce grand évènement, le vendredi 30 janvier, et consacrée entièrement à ce logiciel et sa communauté.

Avec la devroom dédiée à PostgreSQL le samedi 31 janvier, deux journées de conférences porteront ainsi sur une grande variété de sujets autour de PostgreSQL, et Dalibo y donnera notamment les présentations suivantes :

Ces 2 présentations s’intègrent dans un programme très riche et très complet. Si vous êtes utilisateur de PostgreSQL, venez passer ces 2 jours à Bruxelles avec nous !

Pour plus de renseignements : http://fosdem2015.pgconf.eu/

PS : Merci à Virginie pour son aide !

mardi 6 janvier 2015 à 14h14

lundi 5 janvier 2015

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 4 janvier 2015

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en janvier

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

Tom Lane a poussé :

  • Assorted minor fixes for psql metacommand docs. Document the long forms of \H \i \ir \o \p \r \w ... apparently, we have a long and dishonorable history of leaving out the unabbreviated names of psql backslash commands. Avoid saying "Unix shell"; we can just say "shell" with equal clarity, and not leave Windows users wondering whether the feature works for them. Improve consistency of documentation of \g \o \w metacommands. There's no reason to use slightly different wording or markup for each one. http://git.postgresql.org/pg/commitdiff/ae17897ce84e545fd5a042530055df728b2ca98f
  • Improve consistency of parsing of psql's magic variables. For simple boolean variables such as ON_ERROR_STOP, psql has for a long time recognized variant spellings of "on" and "off" (such as "1"/"0"), and it also made a point of warning you if you'd misspelled the setting. But these conveniences did not exist for other keyword-valued variables. In particular, though ECHO_HIDDEN and ON_ERROR_ROLLBACK include "on" and "off" as possible values, none of the alternative spellings for those were recognized; and to make matters worse the code would just silently assume "on" was meant for any unrecognized spelling. Several people have reported getting bitten by this, so let's fix it. In detail, this patch: 1. Allows all spellings recognized by ParseVariableBool() for ECHO_HIDDEN and ON_ERROR_ROLLBACK. 2. Reports a warning for unrecognized values for COMP_KEYWORD_CASE, ECHO, ECHO_HIDDEN, HISTCONTROL, ON_ERROR_ROLLBACK, and VERBOSITY. 3. Recognizes all values for all these variables case-insensitively; previously there was a mishmash of case-sensitive and case-insensitive behaviors. Back-patch to all supported branches. There is a small risk of breaking existing scripts that were accidentally failing to malfunction; but the consensus is that the chance of detecting real problems and preventing future mistakes outweighs this. http://git.postgresql.org/pg/commitdiff/28551797a46c0ada035c34cf9cf2bc90448e3c26
  • Print more information about getObjectIdentityParts() failures. This might help us debug what's happening on some buildfarm members. In passing, reduce the message from ereport to elog --- it doesn't seem like this should be a user-facing case, so not worth translating. http://git.postgresql.org/pg/commitdiff/a486841eb11517e4a344fdebaf370f425a171c85
  • Docs: improve descriptions of ISO week-numbering date features. Use the phraseology "ISO 8601 week-numbering year" in place of just "ISO year", and make related adjustments to other terminology. The point of this change is that it seems some people see "ISO year" and think "standard year", whereupon they're surprised when constructs like to_char(..., "IYYY-Michael Meskes-DD") produce nonsensical results. Perhaps hanging a few more adjectives on it will discourage them from jumping to false conclusions. I put in an explicit warning against that specific usage, too, though the main point is to discourage people who haven't read this far down the page. In passing fix some nearby markup and terminology inconsistencies. http://git.postgresql.org/pg/commitdiff/2f03ae69875ff27a9667a7ec4655434900b64e55
  • Don't run rowsecurity in parallel with other regression tests. The short-lived event trigger in the rowsecurity test causes irreproducible failures when the concurrent tests do something that the event trigger can't cope with. Per buildfarm. http://git.postgresql.org/pg/commitdiff/7161b082bd9fc51e67a1031ea9d0313e8a48286b
  • Treat negative values of recovery_min_apply_delay as having no effect. At one point in the development of this feature, it was claimed that allowing negative values would be useful to compensate for timezone differences between master and slave servers. That was based on a mistaken assumption that commit timestamps are recorded in local time; but of course they're in UTC. Nor is a negative apply delay likely to be a sane way of coping with server clock skew. However, the committed patch still treated negative delays as doing something, and the timezone misapprehension survived in the user documentation as well. If recovery_min_apply_delay were a proper GUC we'd just set the minimum allowed value to be zero; but for the moment it seems better to treat negative settings as if they were zero. In passing do some extra wordsmithing on the parameter's documentation, including correcting a second misstatement that the parameter affects processing of Restore Point records. Issue noted by Michael Paquier, who also provided the code patch; doc changes by me. Back-patch to 9.4 where the feature was introduced. http://git.postgresql.org/pg/commitdiff/d6657d2a107bee20d63ec2f776d873242f9355e9

Tatsuo Ishii a poussé :

Heikki Linnakangas a poussé :

  • Revert the GinMaxItemSize calculation so that we fit 3 tuples per page. Commit 36a35c55 changed the divisor from 3 to 6, for no apparent reason. Reducing GinMaxItemSize like that created a dump/reload hazard: loading a 9.3 database to 9.4 might fail with "index row size XXX exceeds maximum 1352 for index ..." error. Revert the change. While we're at it, make the calculation slightly more accurate. It used to divide the available space on page by three, then subtract sizeof(ItemIdData), and finally round down. That's not totally accurate; the item pointers for the three items are packed tight right after the page header, but there is alignment padding after the item pointers. Change the calculation to reflect that, like BTMaxItemSize does. I tested this with different block sizes on systems with 4- and 8-byte alignment, and the value after the final MAXALIGN_DOWN was the same with both methods on all configurations. So this does not make any difference currently, but let's be tidy. Also add a comment explaining what the macro does. This fixes bug #12292 reported by Robert Thaler. Backpatch to 9.4, where the bug was introduced. http://git.postgresql.org/pg/commitdiff/930fd68455576dada48521a6cef642caddea3c63

Álvaro Herrera a poussé :

  • Fix object_address expected output. Per pink buildfarm http://git.postgresql.org/pg/commitdiff/5b447ad3a98aa6f059ba467eb10a832eb1544985
  • Use TypeName to represent type names in certain commands. In COMMENT, DROP, SECURITY LABEL, and the new pg_get_object_address function, we were representing types as a list of names, same as other objects; but types are special objects that require their own representation to be totally accurate. In the original COMMENT code we had a note about fixing it which was lost in the course of c10575ff005. Change all those places to use TypeName instead, as suggested by that comment. Right now the original coding doesn't cause any bugs, so no backpatch. It is more problematic for proposed future code that operate with object addresses from the SQL interface; type details such as array-ness are lost when working with the degraded representation. Thanks to Petr Jelínek and Dimitri Fontaine for offlist help on finding a solution to a shift/reduce grammar conflict. http://git.postgresql.org/pg/commitdiff/3f88672a4e4d8e648d24ccc65937da61c7660854
  • Add pg_identify_object_as_address. This function returns object type and objname/objargs arrays, which can be passed to pg_get_object_address. This is especially useful because the textual representation can be copied to a remote server in order to obtain the corresponding OID-based address. In essence, this function is the inverse of recently added pg_get_object_address(). Catalog version bumped due to the addition of the new function. Also add docs to pg_get_object_address. http://git.postgresql.org/pg/commitdiff/a676201490c8113b4692562126c77a29dfd8dac1
  • pg_event_trigger_dropped_objects: Add name/args output columns. These columns can be passed to pg_get_object_address() and used to reconstruct the dropped objects identities in a remote server containing similar objects, so that the drop can be replicated. Reviewed by Stephen Frost, Heikki Linnakangas, Abhijit Menon-Sen, Andres Freund. http://git.postgresql.org/pg/commitdiff/72dd233d3ef12da0f041bb3024deaa6d2950369c
  • Add missing pstrdup calls. The one for the OCLASS_COLLATION case was noticed by CLOBBER_CACHE_ALWAYS buildfarm members; the others I spotted by manual code inspection. Also remove a redundant check. http://git.postgresql.org/pg/commitdiff/ba66c9d0681f0c5ec834255fb4e7f6ef6b626747
  • Fix thinko in lock mode enum Commit 0e5680f4737a9c6aa94aa9e77543e5de60411322 contained a thinko mixing LOCKMODE with LockTupleMode. This caused misbehavior in the case where a tuple is marked with a multixact with at most a FOR SHARE lock, and another transaction tries to acquire a FOR NO KEY EXCLUSIVE lock; this case should block but doesn't. Include a new isolation tester spec file to explicitely try all the tuple lock combinations; without the fix it shows the problem: starting permutation: s1_begin s1_lcksvpt s1_tuplock2 s2_tuplock3 s1_commit step s1_begin: BEGIN; step s1_lcksvpt: SELECT * FROM multixact_conflict FOR KEY SHARE; SAVEPOINT foo; a 1 step s1_tuplock2: SELECT * FROM multixact_conflict FOR SHARE; a 1 step s2_tuplock3: SELECT * FROM multixact_conflict FOR NO KEY UPDATE; a 1 step s1_commit: COMMIT; With the fixed code, step s2_tuplock3 blocks until session 1 commits, which is the correct behavior. All other cases behave correctly. Backpatch to 9.3, like the commit that introduced the problem. http://git.postgresql.org/pg/commitdiff/d5e3d1e969d2f65009f718d3100d6565f47f9112

Robert Haas a poussé :

Magnus Hagander a poussé :

Andres Freund a poussé :

  • Prevent WAL files created by pg_basebackup -x/X from being archived again. WAL (and timeline history) files created by pg_basebackup did not maintain the new base backup's archive status. That's currently not a problem if the new node is used as a standby - but if that node is promoted all still existing files can get archived again. With a high wal_keep_segment settings that can happen a significant time later - which is quite confusing. Change both the backend (for the -x/-X fetch case) and pg_basebackup (for -X stream) itself to always mark WAL/timeline files included in the base backup as .done. That's in line with walreceiver.c doing so. The verbosity of the pg_basebackup changes show pretty clearly that it needs some refactoring, but that'd result in not be backpatchable changes. Backpatch to 9.1 where pg_basebackup was introduced. Discussion: 20141205002854.GE21964@awork2.anarazel.de http://git.postgresql.org/pg/commitdiff/2c0a4858965f1375dadb45df9f3a054bfcb283f5
  • Add pg_string_endswith as the start of a string helper library in src/common. Backpatch to 9.3 where src/common was introduced, because a bugfix that needs to be backpatched, requires the function. Earlier branches will have to duplicate the code. http://git.postgresql.org/pg/commitdiff/ccb161b66addc9d0ede31359c05f7e9df61ab8d4
  • Fix inconsequential fd leak in the new mark_file_as_archived() function. As every error in mark_file_as_archived() will lead to a failure of pg_basebackup the FD leak couldn't ever lead to a real problem. It seems better to fix the leak anyway though, rather than silence Coverity, as the usage of the function might get extended or copied at some point in the future. Pointed out by Coverity. Backpatch to 9.2, like the relevant part of the previous patch. http://git.postgresql.org/pg/commitdiff/0398ece4c5baacc98f0fd46a731518b3ccb25bb3
  • Remove superflous variable from xlogreader's XLogFindNextRecord(). Pointed out by Coverity. Since this is mere, and debatable, cosmetics I'm not backpatching this. http://git.postgresql.org/pg/commitdiff/14570c28289f82030172c699ec877dd26d04940a
  • Add missing va_end() call to a early exit in dmetaphone.c's StringAt(). Pointed out by Coverity. Backpatch to all supported branches, the code has been that way for a long while. http://git.postgresql.org/pg/commitdiff/58bc4747be26f6849ca38e67e24abdd6aecba3b1
  • Fix off-by-one in pg_xlogdump's fuzzy_open_file(). In the unlikely case of stdin (fd 0) being closed, the off-by-one would lead to pg_xlogdump failing to open files. Spotted by Coverity. Backpatch to 9.3 where pg_xlogdump was introduced. http://git.postgresql.org/pg/commitdiff/d1c575230d49929f82c6d91e9b3070a9f4018718
  • Correctly handle test durations of more than 2147s in pg_test_timing. Previously the computation of the total test duration, measured in microseconds, accidentally overflowed due to accidentally using signed 32bit arithmetic. As the only consequence is that pg_test_timing invocations with such, overly large, durations never finished the practical consequences of this bug are minor. Pointed out by Coverity. Backpatch to 9.2 where pg_test_timing was added. http://git.postgresql.org/pg/commitdiff/8cadeb792cd08478a73cb0941bb67f03e8465090
  • Add error handling for failing fstat() calls in copy.c. These calls are pretty much guaranteed not to fail unless something has gone horribly wrong, and even in that case we'd just error out a short time later. But since several code checkers complain about the missing check it seems worthwile to fix it nonetheless. Pointed out by Coverity. http://git.postgresql.org/pg/commitdiff/2ea95959afa225118374ab1691a5ccf84ae05ce8

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Abhijit Menon-Sen sent in another revision of a patch to implement pg_audit.
  • Adam Brightwell sent in a patch to remove CATUPDATE.
  • Peter Geoghegan sent in two revisions of a patch to document bt_page_items()'s ctid field.
  • Abhijit Menon-Sen sent in three more revisions of a patch to implement more CRC algorithms, using more efficient ones when available.
  • Bruce Momjian sent in two patches to align BufferDescriptions correctly.
  • Álvaro Herrera sent in a patch to use TypeName to represent type names in certain commands.
  • Álvaro Herrera sent in a patch to add SQL-level callable function to obtain object type + identity, etc.
  • Alexei Vasiliev sent in two more revisions of a patch to add a recovery_timeout option to control the timeout of a restore_command nonzero status code.
  • David Fetter sent in a patch to fix service and URI requests in psql's \c[onnect] command.
  • David Rowley sent in a patch to improve performance for outer joins where outer side is unique.
  • Fabien COELHO sent in a patch to standardize some wording across the function documentation.
  • Fabien COELHO and David Rowley traded patches to add the modulo (%) operator to pgbench.
  • Amit Kapila sent in another revision of a patch to allow parallel cores to be used by vacuumdb.
  • Heikki Linnakangas sent in another revision of a patch to redesign checkpoint segments.
  • Noah Misch sent in a patch to try to track down a buildfarm failure in transaction isolation.
  • Ashutosh Bapat sent in a patch to attempt to use 2PC on transactions involving multiple foreign PostgreSQL servers.
  • Peter Geoghegan sent in two revisions of a patch to fix some issues in value locking.
  • David Fetter sent in a patch to fix the documentation for the default location of the system-wide pg_service configuration.

par N Bougain le lundi 5 janvier 2015 à 18h39

jeudi 1 janvier 2015

ulhume

Rooter le LG G Pad 7.0

Lorsque l&aposon achète un device Android, se pose toujours le même problème du &aposcomment le rooter&apos. Voici donc comment faire pour la toute nouvelle tablette LG G Pad 6.0.

Pourquoi faire ?

Comme mon sujet pour l&aposannée 2015 va clairement être le développement d&aposapplications mobile, après m&aposêtre commis à acheter un Mac Mini et un iPad Mini, j&aposai aussi fait l&aposacquisition d&aposun fairphone et d&aposune tablette Android, le LG G Pad 7.0.

Bref, tout cela est bien beau, mais pour bosser avec Android, rooter est l&aposétape nécessaire. C&aposest déjà pour moi une nécessité philosophique : l&aposidée d&aposavoir payé un engin dont je ne peux pas faire ce que je veux m&aposest basiquement insupportable. Mais au delà de mes états d&aposâme, l&aposaccès root permet de faire des choses indispensables comme, par exemple, utiliser ADB en mode réseau (c&aposest à dire sans cable USB). Cela permet aussi d&aposinstaller d&aposautres versions d&aposAndroid, ce qui n&aposest pas forcement nécessaire tout de suite, mais qui le deviendra inéluctablement lorsque le constructeur aura décrété que votre appareil est en "fin de vie" et qu&aposil ne maintiendra plus son système d&aposexploitation.

Côté fairphone, c&aposest du velour. En effet ce téléphone ne se contente pas d&aposêtre humainement éthique, il l&aposest aussi techniquement. Entendez par là qu&aposil est fournit avec un manuel de démontage, un catalogue de pièces détachées abordables et surtout il est rooté en standard. Que du bonheur donc.

Pour ce qui est du LG c&aposest une autre paire de manche. Ce constructeur, comme beaucoup d&aposautres, ne considère en effet pas normal d&aposavoir le droit d&aposaccéder totalement à sa machine. Voyons comment y remédier. À noter que cette technique semble être la même pour les autres tablettes de la série (8.0 et 10.3) ainsi que pour les smartphones LG.

Notez aussi que tout ce qui suit est fait à vos risques et périls. Tout ce qui suit est de nature à annuler votre garantie et je ne me considérerais pas responsable si vous bloquez votre machine.

Passer en mode développeur

La première étape consiste déjà à activer le mode développeur, ce qui n&aposest pas aussi évident que l&aposon pourrait se l&aposimaginer. Pour cela vous devrez aller dans les réglages, puis dans le menu à propos de la tablette, et enfin dans information sur le logiciel. Arrivé là, accrochez-vous bien, vous devez taper plusieurs fois sur le Numéro de build. La tablette vous demande alors si vous êtes certain de votre action, puis fera apparaître, à la positive, le menu tant utile pour les développeurs.

Dans ce menu, vous allez devoir vous rendre dans la section debuggage pour activer le debuggage de la connection USB. Ce qui est le pré-requis indispensable pour pouvoir utiliser ADB mais aussi pour pouvoir rooter l&aposappareil.

Purple Drake

Pour le rooting à proprement parlé, le sésame s&aposappelle Purple Drake. Téléchargez donc la dernière version (R3 dans mon cas) et décompressez là en local.

Étape spécial "Wheezy"

Pour ceux qui sont sur une version récente du kernel, cette étape peut être zappée. Dans mon cas, la version de GLibC incluse dans Debian Wheezy ne me permet de lancer le script tel quel avec les versions binaires d&aposadb incluse dans l&aposarchive.

Cela se règle cependant simplement en installant la version debian d&aposadb par sudo apt-get install android-adb. Ceci fait, allez dans le dossier assets de l&aposarchive décompressée de Purple Drake et éditez le fichier purpledrake_main.sh pour remplacer en ligne 16, $1 par /usr/bin.

Lorsque tout est en ordre, il ne reste plus qu&aposà lancer l&aposoutil. Assurez-vous que la tablette n&aposa aucune application de lancée (rebootez là si nécessaire), que le cable USB est bien connecté, et que dans la barre de status de la tablette vous voyez bien que la connection USB se fait en mode debuggage.

Si tout est OK, lancez le rooting par sudo ./purpledrake_linux.sh. La raison du sudo ici est que sous Debian, en standard, seul root a accès au device USB. Cela peut se configurer au niveau d&aposudev mais ça me saoule un peu d&aposavoir à faire cela à chaque fois, sur chaque machine et pour chaque device. Et c&aposest d&aposailleurs l&aposune des raisons qui me fait passer ADB en mode réseau.

Une fois l&aposoutil lancé il suffit de se laisser guider par le script. Il va d&aposabord rebooter le device, puis installer un root temporaire, puis l&aposutiliser, si vous le désirez, pour mettre en place le root permanent.

Une fois la tablette redémarrée, tout application qui demande l&aposaccès root devrait ainsi l&aposobtenir. C&aposest une première étape mais ce n&aposest pas très sécurisé, loin de là.

Super pouvoirs à la demande

Pour aller un cran plus loin, rendez vous sur le market et téléchargez SuperSU. Cette application au démarrage va remplacer la commande su fournie par Purple Drake, par une version qui vous demandera si telle application a bien le droit d&aposobtenir l&aposaccès root. Au premier lancement, SuperSU va vous proposer une procédure de remplacement de la commande en mode normal ou recovery. J&aposai personnellement pris l&aposoption normal. Et après une installation avec succès suivi d&aposun redémarrage de l&aposengin, tout était opérationnel.

Tester le tout

Pour tester, le plus simple est d&aposinstaller ADB Wifi à partir du market et de le lancer. Si les étapes précédentes ont fonctionnées, lorsque vous activerez la ADB en mode réseau, une boite de dialogue doit apparaître pour valider l&aposaccès.

Ceci fait, ADB Wifi doit vous indiquer qu&aposil est en écoute et vous fournis l&aposIP de connection. Vous n&aposavez alors plus qu&aposà vous connecter de votre machine comme ceci :

$sudo adb connect 192.168.154.21
connected to 192.168.154.21:5555
$sudo adb shell

Conclusion

Il est toujours navrant d&aposavoir à perdre du temps sur quelque chose d&aposaussi trivial. Espérons que peu à peu les constructeurs s&aposinspire de FairPhone et arrêtent ainsi de prendre leurs clients pour des crétins... On peut toujours rêver ;-)

```

jeudi 1 janvier 2015 à 13h21

mardi 30 décembre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 29 décembre 2014

L'appel à conférenciers pour la PGCon 2015 (16-20 juin) a été lancé. Dépôt des candidatures jusqu'au 19 janvier 2014. Détails : http://www.pgcon.org/2015/papers.php

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en décembre

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é :

Andrew Dunstan a poussé :

Peter Eisentraut a poussé :

  • Change local_preload_libraries to PGC_USERSET. This allows it to be used with ALTER ROLE SET. Although the old setting of PGC_BACKEND prevented changes after session start, after discussion it was more useful to allow ALTER ROLE SET instead and just document that changes during a session have no effect. This is similar to how session_preload_libraries works already. An alternative would be to change things to allow PGC_BACKEND and PGC_SU_BACKEND settings to be changed by ALTER ROLE SET. But that might need further research (e.g., log_connections would probably not work). based on patch by Kyotaro Horiguchi http://git.postgresql.org/pg/commitdiff/584e35d17c00b69d598522d3cf321fbd9b7dbd03

Álvaro Herrera a poussé :

  • get_object_address: separate domain constraints from table constraints. Apart from enabling comments on domain constraints, this enables a future project to replicate object dropping to remote servers: with the current mechanism there's no way to distinguish between the two types of constraints, so there's no way to know what to drop. Also added support for the domain constraint comments in psql's \dd and pg_dump. Catalog version bumped due to the change in ObjectType enum. http://git.postgresql.org/pg/commitdiff/7eca575d1c28f6eee2bf4564f3d458d10c4a8f47
  • Use a bitmask to represent role attributes. The previous representation using a boolean column for each attribute would not scale as well as we want to add further attributes. Extra auxilliary functions are added to go along with this change, to make up for the lost convenience of access of the old representation. Catalog version bumped due to change in catalogs and the new functions. Author: Adam Brightwell, minor tweaks by Álvaro Reviewed by: Stephen Frost, Andres Freund, Álvaro Herrera http://git.postgresql.org/pg/commitdiff/1826987a46d079458007b7b6bbcbbd852353adbb
  • Add SQL-callable pg_get_object_address. This allows access to get_object_address from SQL, which is useful to obtain OID addressing information from data equivalent to that emitted by the parser. This is necessary infrastructure of a project to let replication systems propagate object dropping events to remote servers, where the schema might be different than the server originating the DROP. This patch also adds support for OBJECT_DEFAULT to get_object_address; that is, it is now possible to refer to a column's default value. Catalog version bumped due to the new function. Reviewed by Stephen Frost, Heikki Linnakangas, Robert Haas, Andres Freund, Abhijit Menon-Sen, Adam Brightwell. http://git.postgresql.org/pg/commitdiff/d7ee82e50f624221db76023c17137661fe69ec61
  • Revert "Use a bitmask to represent role attributes". This reverts commit 1826987a46d079458007b7b6bbcbbd852353adbb. The overall design was deemed unacceptable, in discussion following the previous commit message; we might find some parts of it still salvageable, but I don't want to be on the hook for fixing it, so let's wait until we have a new patch. http://git.postgresql.org/pg/commitdiff/a609d96778c1714b9af916477b2c30891fbe578a
  • Grab heavyweight tuple lock only before sleeping. We were trying to acquire the lock even when we were subsequently not sleeping in some other transaction, which opens us up unnecessarily to deadlocks. In particular, this is troublesome if an update tries to lock an updated version of a tuple and finds itself doing EvalPlanQual update chain walking; more than two sessions doing this concurrently will find themselves sleeping on each other because the HW tuple lock acquisition in heap_lock_tuple called from EvalPlanQualFetch races with the same tuple lock being acquired in heap_update -- one of these sessions sleeps on the other one to finish while holding the tuple lock, and the other one sleeps on the tuple lock. Per trouble report from Andrew Sackville-West in http://www.postgresql.org/message-id/20140731233051.GN17765@andrew-ThinkPad-X230 His scenario can be simplified down to a relatively simple isolationtester spec file which I don't include in this commit; the reason is that the current isolationtester is not able to deal with more than one blocked session concurrently and it blocks instead of raising the expected deadlock. In the future, if we improve isolationtester, it would be good to include the spec file in the isolation schedule. I posted it in http://www.postgresql.org/message-id/20141212205254.GC1768@alvh.no-ip.org Hat tip to Mark Kirkwood, who helped diagnose the trouble. http://git.postgresql.org/pg/commitdiff/0e5680f4737a9c6aa94aa9e77543e5de60411322
  • Remove event trigger from object_address test. It is causing trouble when run in parallel mode, because dropping the function other sessions are running concurrently causes them to fail due to inability to find the function. Per buildfarm, as noted by Tom Lane. http://git.postgresql.org/pg/commitdiff/289121a452e3c255e4fd63dbb0252261605c2eaf
  • Restrict name list len for domain constraints. This avoids an ugly-looking "cache lookup failure" message. Ugliness pointed out by Andres Freund. http://git.postgresql.org/pg/commitdiff/6630420fc9139c3a1ee051bc2f2ae8fa32e71c62

Tom Lane a poussé :

Bruce Momjian a poussé :

Fujii Masao a poussé :

Andres Freund a poussé :

  • Suppress MSVC warning in typeStringToTypeName function. MSVC doesn't realize ereport(ERROR) doesn't return. David Rowley http://git.postgresql.org/pg/commitdiff/cd5ebe1edd6d9c19caba406a90f626afec5d3f0a
  • Convert the PGPROC->lwWaitLink list into a dlist instead of open coding it. Besides being shorter and much easier to read it changes the logic in LWLockRelease() to release all shared lockers when waking up any. This can yield some significant performance improvements - and the fairness isn't really much worse than before, as we always allowed new shared lockers to jump the queue. http://git.postgresql.org/pg/commitdiff/7882c3b0b95640e361f1533fe0f2d02e4e5d8610
  • Add capability to suppress CONTEXT: messages to elog machinery. Hiding context messages usually is not a good idea - except for rather verbose debugging/development utensils like LOG_DEBUG. There the amount of repeated context messages just bloat the log without adding information. http://git.postgresql.org/pg/commitdiff/570bd2b3fd20d3f8896f5e6a8133d6aed385ac86
  • Lockless StrategyGetBuffer clock sweep hot path. StrategyGetBuffer() has proven to be a bottleneck in a number of buffer acquisition heavy workloads. To some degree this has already been alleviated by 5d7962c6, but it still can be quite a heavy bottleneck. The problem is that in unfortunate usage patterns a single StrategyGetBuffer() call will have to look at a large number of buffers - in turn making it likely that the process will be put to sleep while still holding the spinlock. Replace most of the usage of the buffer_strategy_lock spinlock for the clock sweep by a atomic nextVictimBuffer variable. That variable, modulo NBuffers, is the current hand of the clock sweep. The buffer clock-sweep then only needs to acquire the spinlock after a wraparound. And even then only in the process that did the wrapping around. That alleviates nearly all the contention on the relevant spinlock, although significant contention on the cacheline can still exist. Reviewed-By: Robert Haas and Amit Kapila. Discussion: 20141010160020.GG6670@alap3.anarazel.de, 20141027133218.GA2639@awork2.anarazel.de http://git.postgresql.org/pg/commitdiff/d72731a70450b5e7084991b9caa15cb58a2820df
  • Blindly fix a dtrace probe in lwlock.c for a removed local variable. Per buildfarm member locust. http://git.postgresql.org/pg/commitdiff/740a4ec7f4adccd56eced452580ccec7157fc8d8
  • Improve LWLock scalability. The old LWLock implementation had the problem that concurrent lock acquisitions required exclusively acquiring a spinlock. Often that could lead to acquirers waiting behind the spinlock, even if the actual LWLock was free. The new implementation doesn't acquire the spinlock when acquiring the lock itself. Instead the new atomic operations are used to atomically manipulate the state. Only the waitqueue, used solely in the slow path, is still protected by the spinlock. Check lwlock.c's header for an explanation about the used algorithm. For some common workloads on larger machines this can yield significant performance improvements. Particularly in read mostly workloads. Reviewed-By: Amit Kapila and Robert Haas. Author: Andres Freund. Discussion: 20130926225545.GB26663@awork2.anarazel.de http://git.postgresql.org/pg/commitdiff/ab5194e6f617a9a9e7aadb3dd1cee948a42d0755

Noah Misch a poussé :

  • Have config_sspi_auth() permit IPv6 localhost connections. Windows versions later than Windows Server 2003 map "localhost" to ::1. Account for that in the generated pg_hba.conf, fixing another oversight in commit f6dc6dd5ba54d52c0733aaafc50da2fbaeabb8b0. Back-patch to 9.0, like that commit. David Rowley and Noah Misch http://git.postgresql.org/pg/commitdiff/8d9cb0bc483431780aef483c7c110ab39e465958

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Michael Paquier sent in another revision of a patch to clarify some points about how numeric functions and operators work.
  • Etsuro Fujita sent in a patch to fix the fact that ExplainModifyTarget does not always show the parent of the inheritance tree in multi-target-table cases.
  • Heikki Linnakangas sent in another revision of a patch to advance local xmin more aggressively using the new pairing heap code.
  • Robert Haas sent in another revision of a patch to implement parallel mode and parallel contexts.
  • Petr (PJMODOS) Jelinek sent in another revision of a patch to implement TABLESAMPLE.
  • Christoph Berg sent in a patch to correct the misapprehension that pg_upgrade requires "postmaster," an entity not present in all live versions of PostgreSQL, when "postgres" will do.
  • Michael Paquier sent in two more revisions of a patch to move contrib binaries to bin.
  • Álvaro Herrera sent in a flock of five patches intended to complete the feature which allows DROP to propagate via WAL.
  • Etsuro Fujita sent in two more revisions of a patch to allow foreign tables to be part of table inheritance hierarchies.
  • Heikki Linnakangas and Teodor Sigaev traded patches to support ranges with B-Tree GIN indexes.
  • Heikki Linnakangas sent in another revision of a patch to add a compress method for SP-GiST.
  • Andres Freund sent in another revision of a patch to add the capability to suppress CONTEXT: messages to elog machinery.
  • Andres Freund sent in another revision of a patch to convert the PGPROC->lwWaitLink list into a dlist instead of open coding it, and one to implement wait-free LW_SHARED LWLock acquisition.
  • Andres Freund sent in a patch to add a lockless StrategyGetBuffer clock sweep hotpath.
  • Michael Paquier sent in a patch to install libpq.dll in bin directory on Windows / Cygwin.
  • Andrew Dunstan sent in a patch to speed up the bin checks.
  • Teodor Sigaev sent in another revision of a patch to speed up tidbitmap using a cache page.
  • Jim Nasby sent in a patch to add a hack to test out several hashing strategies.
  • Andreas Karlsson sent in another revision of a patch to use 128-bit integers for sum, avg and statistics aggregates.
  • Bruce Momjian sent in a patch to fix an issue where misaligned BufferDescriptors is causing major performance problems on AMD.
  • Jeff Davis sent in another revision of a patch to implement spill-to-disk for HashAggs.
  • Alexander Shulgin sent in another revision of a patch to turn recovery.conf into GUCs.
  • Kaigai Kouhei sent in another revision of a patch to add a CTID scan as an example of the custom scan capability.
  • David Rowley and Noah Misch traded patches to update Windows with the changes that secured "make check."
  • Abhijit Menon-Sen sent in a patch to use CPUID at startup to determine whether the SSE4.2 CRC instructions are available, and to use them instead of the slice-by-8 implementation if they are.
  • Fujii Masao and Michael Paquier traded patches implementing compression of full-page writes.
  • Abhijit Menon-Sen sent in a patch to implement a fast bloat measurement tool.
  • Alexander Shulgin and Pavel Stehule traded patches to allow COPY to handle wrong rows without rolling back entirely.
  • Alexey Vasiliev sent in a patch to add recovery_timeout option to control timeout of restore_command nonzero status code.
  • Peter Geoghegan sent in another revision of a patch to implement INSERT ... ON CONFLICT {UPDATE | IGNORE}.
  • Ian Lawrence Barwick sent in a patch to fix psql's tab completion of COMMENT ON not to repeat IS more than needed.
  • Amit Kapila and Dilip Kumar traded patches to enable vacuumdb to use parallel cores.

par N Bougain le mardi 30 décembre 2014 à 20h21

dimanche 28 décembre 2014

Guillaume Lelarge

Manuel de la 9.4 et articles GLMF

Trois billets en 2014 (avec celui-là), j'aurais fait fort :)

Néanmoins, quelques informations importantes.

Tout d'abord, la documentation de PostgreSQL 9.4 est enfin disponible entièrement en français, avec les différents formats habituels. C'est comme d'habitude sur http://docs.postgresql.fr.

Ensuite, au niveau des articles pour le GNU/Linux Magazine France, deux articles sont parus sur la version 9.4, un peu avant la sortie (les numéros 175 et 177). La suite de la série sur le planificateur est prévue rapidement avec un article sur les jointures. Il s'agit donc du deuxième article. Les troisième et quatrième articles sont déjà dans le bureau du rédacteur en chef (depuis août en fait). Ils devraient sortir rapidement après, suivant la place disponible dans le magazine.

Et voilà. L'année 2015 devrait être très intéressante :) Quelques infos plus tard à ce sujet.

par Guillaume Lelarge le dimanche 28 décembre 2014 à 11h36

mardi 23 décembre 2014

Actualités PostgreSQL.fr

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

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

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é :

Heikki Linnakangas a poussé :

Álvaro Herrera a poussé :

Noah Misch a poussé :

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é :

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é :

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.

par N Bougain le mardi 23 décembre 2014 à 23h31

jeudi 18 décembre 2014

Actualités PostgreSQL.fr

PostgreSQL 9.4.0


Contenu

  Texte original
  Détail des fonctionnalités
  Téléchargement
  Documentation
  Licence
  Contacts
  Images et Logos
  Informations concernant les sociétés citées
  Support professionnel

Texte original

PostgreSQL 9.4 améliore la flexibilité, l'évolutivité et les performances

18 DÉCEMBRE 2014 : Le PostgreSQL Global Development Group annonce la sortie de PostgreSQL 9.4. Il s'agit de la dernière version en date du système de gestion de bases de données libre de référence. Cette version ajoute de nombreuses fonctionnalités qui améliorent la flexibilité, l'évolutivité et les performances de PostgreSQL. Et cela pour de nombreux cas d'utilisation différents, avec notamment l'amélioration du support de JSON, de la réplication et de la performance de l'indexation.

Flexibilité

Avec le nouveau type de données JSONB, plus besoin de choisir entre le stockage relationnel et non-relationnel : il y a les deux à la fois. JSONB supporte les recherches rapides et les requêtes de recherche d'expressions simples en utilisant les index de type Generalized Inverted Indexes (GIN). De nombreuses nouvelles fonctions permettent de manipuler les données JSON, avec des performances souvent meilleures que celles obtenues avec les bases de données orientées document les plus populaires. Avec JSONB, les données des tables peuvent être facilement intégrées à celles des documents permettant d'obtenir un environnement de bases de données complètement intégré.

« JSONB rapproche PostgreSQL des développeurs de la communauté JavaScript en permettant aux données JSON d'être stockées et requêtées nativement. node.js et les autres frameworks JavaScript côté serveur peuvent désormais profiter de la sécurité et de la robustesse de PostgreSQL, tout en continuant à stocker les données dans le format sans schéma qu'ils préfèrent », précise Matt Soldo, Responsable Produit chez Heroku Postgres.

Evolutivité

Avec la 9.4, le décodage logique (Logical Decoding) offre une nouvelle API pour lire, filtrer et manipuler le flux de réplication de PostgreSQL. Cette interface est la fondation de nouveaux outils de réplication, comme la réplication bi-directionnelle (Bi-Directional Replication), qui permet la création de grappes PostgreSQL multi-maîtres. D'autres améliorations dans la réplication système concernent l'administration et l'utilisation des réplicats, notamment les connecteurs de réplication et les réplicats différés.

« La raison principale à notre adoption immédiate de PostgreSQL 9.4 en production est la nouvelle fonctionnalité de décodage logique », explique Marco Favale, responsable de production Cartographique chez Navionics. « La possibilité d'écrire des greffons de sortie personnalisés et flexibles nous permettra de récupérer de manière transparente les modifications sur certaines tables et de les répliquer où nous voulons, tout en supprimant les contraintes relatives aux solutions de réplication par triggers, lourdes et plus complexes à gérer. »

« Zalando dépend de la stabilité et des performances de centaines de serveurs de bases de données PostgreSQL pour satisfaire des millions de clients partout en Europe », annonce Valentine Gogichashvili, Team Lead Database Operations chez Zalando Technologies. « Nous sommes impatients d'utiliser la réplication différée, immédiatement utilisable, et nous allons évaluer les outils de réplication bi-directionnelle dès qu'ils seront disponibles. »

Performances

La version 9.4 apporte également de multiples gains de performance, permettant aux utilisateurs de tirer plus d'avantages de leur serveur PostgreSQL dont :

  • des améliorations des index GIN, avec une taille réduite de 50% et une vitesse multipliée par 3 ;
  • des vues matérialisées qui peuvent être mises à jour de manière concurrente, pour du reporting plus rapide et plus à jour ;
  • le rechargement rapide du cache de base de données au redémarrage avec pg_prewarm ;
  • une écriture parallèle plus rapide des journaux de transaction de PostgreSQL.

« Nous allons vraiment beaucoup gagner avec le rafraichissement concurrent des vues matérialisées, les réplicats différés (qui permettront aux restaurations après incident d'être plus robustes), ainsi qu'avec les améliorations de performances apportées par chaque nouvelle version », ajoute Marco Favale.

Détail des fonctionnalités

Plus d'informations sur les fonctionnalités ci-dessus et les autres dans les liens suivants :

Téléchargement

Documentation

La documentation au format HTML et les pages de manuel sont installées avec PostgreSQL. La documentation en ligne, exhaustive et interactive, peut être parcourue, interrogée et commentée librement.

Licence

PostgreSQL utilise la licence PostgreSQL, une licence permissive de type BSD. Cette licence certifiée par l'OSI est largement appréciée pour sa flexibilité et sa compatibilité avec le monde des affaires, puisqu'elle ne restreint pas l'utilisation de PostgreSQL dans les applications propriétaires ou commerciales. Associée à un support proposé par de multiples sociétés et une propriété publique du code, sa licence rend PostgreSQL très populaire parmi les revendeurs souhaitant embarquer une base de données dans leurs produits sans avoir à se soucier des prix de licence, des verrous commerciaux ou modifications des termes de licence.

Contacts

Pages Web

Contact presse

France et pays francophones
Stéphane Schildknecht
fr at postgresql dot org
+33 (0) 617 11 37 42

Pour les contacts d'autres régions, consulter la liste des contacts internationaux.

Images et Logos

Tous les logos sont modifiables et redistribuables selon les termes de la licence PostgreSQL. Le nom PostgreSQL et le logo sont des marques déposées de la PostgreSQL Community Association of Canada.

Informations concernant les sociétés citées

« JSONB rapproche PostgreSQL des développeurs de la communauté JavaScript en permettant aux données JSON d'être stockées et requêtées nativement. node.js et les autres frameworks JavaScript côté serveur peuvent désormais profiter de la sécurité et de la robustesse de PostgreSQL, tout en continuant à stocker les données dans le format sans schéma qu'ils préfèrent », précise Matt Soldo, Responsable Produit chez Heroku Postgres.

À propos de Heroku : Heroku est le leader des plateformes en tant que service (PaaS), orienté sur la facilité d'utilisation, l'automatisation, et la fiabilité. Heroku, dont le siège se trouve à San Francisco, en Californie, est un supporter passioné et actif sur les technologies Ruby et les architectures en nuage. Pour plus d'informations, visitez notre site web et notre blog ou suivez Heroku sur Twitter. Heroku est une filiale, propriété exclusive de salesforce.com. Contact (uniquement en Anglais): Heroku PR

« La raison principale à notre adoption immédiate de PostgreSQL 9.4 en production est la nouvelle fonctionnalité de décodage logique », explique Marco Favale, responsable de production Cartographique chez Navionics. « La possibilité d'écrire des greffons de sortie personnalisés et flexibles nous permettra de récupérer de manière transparente les modifications sur certaines tables et de les répliquer où nous voulons, tout en supprimant les contraintes relatives aux solutions de réplication par triggers, lourdes et plus complexes à gérer. »

« Nous allons vraiment beaucoup gagner avec le rafraichissement concurrent des vues matérialisées, les réplicats différés (qui permettront aux restaurations après incident d'être plus robustes), ainsi qu'avec les améliorations de performances apportées par chaque nouvelle version », ajoute Marco Favale.

À propos de Navionics : Navionics (www.navionics.com) dispose de la plus important base de données de cartes marines, de voies navigables et de lacs au monde, couvrant les océans, toutes les mers de la planète ainsi que des centaines de milliers de lacs et rivières. Nombre de ces cartes ont été élaborées par le biais d'enquêtes exclusives de Navionics réalisées à la fois sur le terrain et par sondage à distance notamment par imagerie satellitaire et scanners laser aéroportés. Navionics est situé en Italie, aux États-Unis, en Inde et en Estonie, avec des ventes et des services partout dans le monde. Contact (Anglais ou Italien): Marco Favale

« Zalando dépend de la stabilité et des performances de centaines de serveurs de bases de données PostgreSQL pour satisfaire des millions de clients partout en Europe. Nous nous tenons à jour des dernières versions de développement de PostgreSQL depuis 2010, lorsque nous avons mis en place la première Release Candidate de PostgreSQL 9.0. Chaque nouvelle version nous apporte plus de performances et des améliorations dont nous bénéficions pratiquement dès le premier jour. Nous sommes impatients d'utiliser la réplication différée, immédiatement utilisable avec PostgreSQL 9.4. Nous allons évaluer les outils de réplication bi-directionnelle, rendus possibles avec l'introduction du décodage logique. Notre équipe travaille déjà à l'amélioration de nos outils de supervision open source qui bénéficieront des statistiques temps réel sur les commandes fournies par le module pg_stat_statements et les multiples améliorations qu'il a reçu dans la version 9.4. Les améliorations des aggrégats, comme filter, rendent l'écriture des requêtes avec aggrégats plus facile et encourangent par la suite nos collègues à écrire du SQL bien plus élégant qu'auparavant », explique Valentine Gogichashvili, responsable des opérations bases de données chez Zalando Technologies.

Zalando est l'une des plus grosses entreprises de e-commerce en europe, opérant dans 15 pays à ce jour. Chez Zalando Technology, nous avons développé l'essentiel de notre plateforme en interne, notamment la boutique, les systèmes internes et le logiciel de logistique. En ce qui concerne le développement et les opérations sur les systèmes, nous utilisons majoritairement des solutions open source et travaillons en petites équipes flexibles. Nos équipes technologiques créent l'incroyable aventure de shopping en ligne Zalando, que des millions de clients apprécient chaque jour. Venez visiter notre site web ou notre blog

Support professionnel

PostgreSQL bénéficie du support de nombreuses sociétés, qui financent des développeurs, fournissent l'hébergement ou un support financier. Les plus fervents supporters sont listés sur la page des mécènes du développement.

Le travail sur JSONB a été financé par Engine Yard et soutenu par Heroku, Andrew Dunstan et plusieurs autres contributeurs. Le travail sur le Décodeur Logique a été piloté par 2ndQuadrant. Plusieurs autres sociétés ont contribué à cette version.

Il existe également une très grande communauté de sociétés fournissant du support PostgreSQL, des consultants indépendants aux sociétés multinationales.

Les dons sont acceptés avec plaisir.

Vous pouvez également acheter des produits dérivés de qualité sur la Boutique Zazzle PostgreSQL.

par SAS le jeudi 18 décembre 2014 à 16h57

mardi 16 décembre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 14 décembre 2014

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/

Le Prague PostgreSQL Developer Day (P2D2) 2015 aura lieu à Prague, République Tchèque, les 11 & 12 février 2015 : http://www.p2d2.cz/

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en décembre

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

Simon Riggs a poussé :

Peter Eisentraut a poussé :

Álvaro Herrera a poussé :

Heikki Linnakangas a poussé :

Tom Lane a poussé :

  • Fix minor thinko in convertToJsonb(). The amount of space to reserve for the value's varlena header is VARHDRSZ, not sizeof(VARHDRSZ). The latter coding accidentally failed to fail because of the way the VARHDRSZ macro is currently defined; but if we ever change it to return size_t (as one might reasonably expect it to do), convertToJsonb() would have failed. Spotted by Mark Dilger. http://git.postgresql.org/pg/commitdiff/24688f4e5a7d5fadde0e43a5b123432d81577d82
  • Fix assorted confusion between Oid and int32. In passing, also make some debugging elog's in pgstat.c a bit more consistently worded. Back-patch as far as applicable (9.3 or 9.4; none of these mistakes are really old). Mark Dilger identified and patched the type violations; the message rewordings are mine. http://git.postgresql.org/pg/commitdiff/06d5803ffa1ea5a42295c9266f30557e44a99de7
  • Fix completely broken REINDEX SCHEMA testcase. Aside from not testing the case it claimed to test (namely a permissions failure), it left a login-capable role lying around, which quite aside from possibly being a security hole would cause subsequent regression runs to fail since the role would already exist. http://git.postgresql.org/pg/commitdiff/58af84f4bba5c87b352cf40e276e287fd289bd77
  • Make rowsecurity test clean up after itself, too. Leaving global objects like roles hanging around is bad practice. http://git.postgresql.org/pg/commitdiff/0845264642d855d92c63c5d05a4ef83245ca16c5
  • Fix corner case where SELECT FOR UPDATE could return a row twice. In READ COMMITTED mode, if a SELECT FOR UPDATE discovers it has to redo WHERE-clause checking on rows that have been updated since the SELECT's snapshot, it invokes EvalPlanQual processing to do that. If this first occurs within a non-first child table of an inheritance tree, the previous coding could accidentally re-return a matching row from an earlier, already-scanned child table. (And, to add insult to injury, I think this could make it miss returning a row that should have been returned, if the updated row that this happens on should still have passed the WHERE qual.) Per report from Kyotaro Horiguchi; the added isolation test is based on his test case. This has been broken for quite awhile, so back-patch to all supported branches. http://git.postgresql.org/pg/commitdiff/2db576ba8c449fcaf61ae7aa14ed62e63ebf5924
  • Fix planning of SELECT FOR UPDATE on child table with partial index. Ordinarily we can omit checking of a WHERE condition that matches a partial index's condition, when we are using an indexscan on that partial index. However, in SELECT FOR UPDATE we must include the "redundant" filter condition in the plan so that it gets checked properly in an EvalPlanQual recheck. The planner got this mostly right, but improperly omitted the filter condition if the index in question was on an inheritance child table. In READ COMMITTED mode, this could result in incorrectly returning just-updated rows that no longer satisfy the filter condition. The cause of the error is using get_parse_rowmark() when get_plan_rowmark() is what should be used during planning. In 9.3 and up, also fix the same mistake in contrib/postgres_fdw. It's currently harmless there (for lack of inheritance support) but wrong is wrong, and the incorrect code might get copied to someplace where it's more significant. Report and fix by Kyotaro Horiguchi. Back-patch to all supported branches. http://git.postgresql.org/pg/commitdiff/462bd95705a0c23ba0b0ba60a78d32566a0384c1
  • Revert misguided change to postgres_fdw FOR UPDATE/SHARE code. In commit 462bd95705a0c23ba0b0ba60a78d32566a0384c1, I changed postgres_fdw to rely on get_plan_rowmark() instead of get_parse_rowmark(). I still think that's a good idea in the long run, but as Etsuro Fujita pointed out, it doesn't work today because planner.c forces PlanRowMarks to have markType = ROW_MARK_COPY for all foreign tables. There's no urgent reason to change this in the back branches, so let's just revert that part of yesterday's commit rather than trying to design a better solution under time pressure. Also, add a regression test case showing what postgres_fdw does with FOR UPDATE/SHARE. I'd blithely assumed there was one already, else I'd have realized yesterday that this code didn't work. http://git.postgresql.org/pg/commitdiff/8ec8760fc87ecde0516e511f1c55aec627b01ea7
  • Avoid instability in output of new REINDEX SCHEMA test. The planner seems to like to do this join query as a hash join, making the output ordering machine-dependent; worse, it's a hash on OIDs, so that it's a bit astonishing that the result doesn't change from run to run even on one machine. Add an ORDER BY to get consistent results. Per buildfarm. I also suppressed output from the final DROP SCHEMA CASCADE, to avoid occasional failures similar to those fixed in commit 81d815dc3ed74a7d. That hasn't been observed in the buildfarm yet, but it seems likely to happen in future if we leave it as-is. http://git.postgresql.org/pg/commitdiff/1c5c70df45714f38c033bb1a272d8db4f2dc8a2f
  • Repair corner-case bug in array version of percentile_cont(). The code for advancing through the input rows overlooked the case that we might already be past the first row of the row pair now being considered, in case the previous percentile also fell between the same two input rows. Report and patch by Andrew Gierth; logic rewritten a bit for clarity by me. http://git.postgresql.org/pg/commitdiff/b0f479113abaf28f1c9ed25d856ffe6fd4bb7dc9
  • Improve recovery target settings documentation. Commit 815d71dee hadn't bothered to update the documentation to match the behavioral change, and a lot of other text in this section was badly in need of copy-editing. http://git.postgresql.org/pg/commitdiff/e311cd6ded096122a5f2b5cbe91bc3a9f0dda3cb
  • Update 9.4 release notes. Set release date, do a final pass of wordsmithing, improve some other new-in-9.4 documentation. http://git.postgresql.org/pg/commitdiff/0923b01e3e64d4985ffbdf8ec912e25ad02e0c0c

Andrew Dunstan a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Petr (PJMODOS) Jelinek sent in two more revisions of a patch to add a shutdown_at_recovery_target option to recovery.conf.
  • Euler Taveira de Oliveira sent in a patch to bring the documentation of pg_receivexlog into line with its new functionality.
  • Peter Geoghegan sent in another revision of a patch to implement INSERT ... ON CONFLICT {UPDATE | IGNORE}.
  • Petr (PJMODOS) Jelinek sent in another revision of a patch to add a sequence access method.
  • Alexander Shulgin sent in two revisions of a patch to track TRUNCATEs in pgstat transaction stats.
  • Robert Haas and Heikki Linnakangas traded patches to advance local xmin more aggressively.
  • Etsuro Fujita sent in another revision of a patch to allow foreign tables to be part of table inheritance hierarchies.
  • Álvaro Herrera sent in a patch to implement logical column ordering.
  • David Rowley sent in another revision of a patch to allow removing INNER JOIN under some circumstances.
  • Matt Newell sent in another revision of a patch to enable libpq pipelining.
  • Heikki Linnakangas improved the performance of k-Nearest-Neighbor GiST index searches using a Pairing Heap http://en.wikipedia.org/wiki/Pairing_heap.
  • Petr (PJMODOS) Jelinek sent in a patch to implement TABLESAMPLE.
  • Jeff Davis sent in another revision of a patch to implement a memory-bounded HashAgg.
  • Mark Dilger sent in a WIP patch to allow printf formatting for Oids.
  • Kyotaro HORIGUCHI and Tom Lane traded patches to fix an issue where some queries return duplicate rows after FOR UPDATE was blocked, in other words, after getting HeapTupleUpdated in ExecLockRows.
  • Simon Riggs sent in another revision of a patch to turn off heap-only tuple cleanup under some circumstances.
  • Heikki Linnakangas and Michael Paquier traded patches to refactor the code for sync node detection.
  • Peter Eisentraut sent in a patch to ensure that VPATH builds not write to the source tree.
  • Kyotaro HORIGUCHI sent in a patch to fix an issue where SELECT FROM <inheritance parent> WHERE <cond> FOR UPDATE may return results which does not match the <cond>.
  • Alexander Shulgin sent in another revision of a patch to turn recovery.conf into GUCs.
  • Robert Haas sent in a patch to add two new concepts: parallel mode, and parallel contexts.
  • Heikki Linnakangas sent in a patch to place pg_rewind, a tool that allows repurposing an old master server as a new standby server, after promotion, even if the old master was not shut down cleanly, in contrib/.
  • Andreas Karlsson sent in a patch to reduce the required lock strength of trigger and foreign key DDL.
  • Tatsuo Ishii sent in a patch to pgbench from exiting when the pg_bench_* tables do not exist.
  • Michael Paquier sent in another revision of a patch to allow compressing full-page writes.
  • Ali Akbar sent in a test for the patch to fix xpath() to return namespace definitions.
  • Emre Hasegeli sent in another revision of a patch to implement a BRIN range operator class.

par N Bougain le mardi 16 décembre 2014 à 22h49

lundi 8 décembre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 7 décembre 2014

Le Prague PostgreSQL Developer Day (P2D2) 2015 aura lieu à Prague, République Tchèque, les 11 & 12 février 2015 : http://www.p2d2.cz/

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en décembre

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

Tom Lane a poussé :

  • Add a #define for the inet overlaps operator. Extracted from pending inet selectivity patch. The rest of it isn't quite ready to commit, but we might as well push this part so the patch doesn't have to track the moving target of pg_operator.h. http://git.postgresql.org/pg/commitdiff/866737c923730f0cf8dde787868ab3ae697a278a
  • Guard against bad "dscale" values in numeric_recv(). We were not checking to see if the supplied dscale was valid for the given digit array when receiving binary-format numeric values. While dscale can validly be more than the number of nonzero fractional digits, it shouldn't be less; that case causes fractional digits to be hidden on display even though they're there and participate in arithmetic. Bug #12053 from Tommaso Sala indicates that there's at least one broken client library out there that sometimes supplies an incorrect dscale value, leading to strange behavior. This suggests that simply throwing an error might not be the best response; it would lead to failures in applications that might seem to be working fine today. What seems the least risky fix is to truncate away any digits that would be hidden by dscale. This preserves the existing behavior in terms of what will be printed for the transmitted value, while preventing subsequent arithmetic from producing results inconsistent with that. In passing, throw a specific error for the case of dscale being outside the range that will fit into a numeric's header. Before you got "value overflows numeric format", which is a bit misleading. Back-patch to all supported branches. http://git.postgresql.org/pg/commitdiff/0927bf8060eca4e220cde48b1425e7bcf7451b94
  • Minor cleanup of function declarations for BRIN. Get rid of PG_FUNCTION_INFO_V1() macros, which are quite inappropriate for built-in functions (possibly leftovers from testing as a loadable module?). Also, fix gratuitous inconsistency between SQL-level and C-level names of the minmax support functions. http://git.postgresql.org/pg/commitdiff/1511521a36f99a242f51c3bd0811cfcd53c5e63a
  • Fix JSON aggregates to work properly when final function is re-executed. Davide S. reported that json_agg() sometimes produced multiple trailing right brackets. This turns out to be because json_agg_finalfn() attaches the final right bracket, and was doing so by modifying the aggregate state in-place. That's verboten, though unfortunately it seems there's no way for nodeAgg.c to check for such mistakes. Fix that back to 9.3 where the broken code was introduced. In 9.4 and HEAD, likewise fix json_object_agg(), which had copied the erroneous logic. Make some cosmetic cleanups as well. http://git.postgresql.org/pg/commitdiff/75ef435218fe4f6ce29d33e10f6f7a328c93f7e7
  • Improve error messages for malformed array input strings. Make the error messages issued by array_in() uniformly follow the style ERROR: malformed array literal: "actual input string" DETAIL: specific complaint here and rewrite many of the specific complaints to be clearer. The immediate motivation for doing this is a complaint from Josh Berkus that json_to_record() produced an unintelligible error message when dealing with an array item, because it tries to feed the JSON-format array value to array_in(). Really it ought to be smart enough to perform JSON-to-Postgres array conversion, but that's a future feature not a bug fix. In the meantime, this change is something we agreed we could back-patch into 9.4, and it should help de-confuse things a bit. http://git.postgresql.org/pg/commitdiff/475aedd1ef0c0f9fc9d675dd2286380d14804975

Magnus Hagander a poussé :

Heikki Linnakangas a poussé :

Andrew Dunstan a poussé :

  • Fix hstore_to_json_loose's detection of valid JSON number values. We expose a function IsValidJsonNumber that internally calls the lexer for json numbers. That allows us to use the same test everywhere, instead of inventing a broken test for hstore conversions. The new function is also used in datum_to_json, replacing the code that is now moved to the new function. Backpatch to 9.3 where hstore_to_json_loose was introduced. http://git.postgresql.org/pg/commitdiff/e09996ff8dee3f70b0a027cffebccef4388ed5b7

Álvaro Herrera a poussé :

  • dummy_seclabel: add sql/, expected/, and .gitignores. Michael Paquier http://git.postgresql.org/pg/commitdiff/332562437724845635f0e11685d11fdfe8719eb2
  • pageinspect/BRIN: minor tweaks. Michael Paquier. Double-dash additions suggested by Peter Geoghegan http://git.postgresql.org/pg/commitdiff/b52cb4690e0752efea440173c4923d76d2126679
  • Install kludges to fix check-world for src/test/modules. check-world failed in a completely clean tree, because src/test/modules fail to build unless errcodes.h is generated first. To fix this, install a dependency in src/test/modules' Makefile so that the necessary file is generated. Even with this, running "make check" within individual module subdirs will still fail because the dependency is not considered there, but this case is less interesting and would be messier to fix. check-world still failed with the above fix in place, this time because dummy_seclabel used LOAD to load the dynamic library, which doesn't work because the @libdir@ (expanded by the makefile) is expanded to the final install path, not the temporary installation directory used by make check. To fix, tweak things so that CREATE EXTENSION can be used instead, which solves the problem because the library path is expanded by the backend, which is aware of the true libdir. http://git.postgresql.org/pg/commitdiff/da34731bd3c805ab77d6e5914d02b1f011e9479d
  • Fix typos http://git.postgresql.org/pg/commitdiff/6597ec9be6a9ed50390f73235d6654ec32a0b944
  • doc: Fix markup. In the spirit of d34b48a021b181e30c53280d336820740f67570b Per buildfarm member guaibasaurus, via Stefan Kaltenbrunner. http://git.postgresql.org/pg/commitdiff/182362b669f484c1f92e058c710b025d25ddc5dd
  • Keep track of transaction commit timestamps. Transactions can now set their commit timestamp directly as they commit, or an external transaction commit timestamp can be fed from an outside system using the new function TransactionTreeSetCommitTsData(). This data is crash-safe, and truncated at Xid freeze point, same as pg_clog. This module is disabled by default because it causes a performance hit, but can be enabled in postgresql.conf requiring only a server restart. A new test in src/test/modules is included. Catalog version bumped due to the new subdirectory within PGDATA and a couple of new SQL functions. Authors: Álvaro Herrera and Petr Jelínek Reviewed to varying degrees by Michael Paquier, Andres Freund, Robert Haas, Amit Kapila, Fujii Masao, Jaime Casanova, Simon Riggs, Steven Singer, Peter Eisentraut http://git.postgresql.org/pg/commitdiff/73c986adde5d73a5e2555da9b5c8facedb146dcd
  • Move security_label test. Rather than have the core security_label regression test depend on the dummy_seclabel module, have that part of the test be executed by dummy_seclabel itself directly. This simplifies the testing rig a bit; in particular it should silence the problems from the MSVC buildfarm phylum, which haven't yet gotten taught how to install src/test/modules. http://git.postgresql.org/pg/commitdiff/df761e3cf79db09d602610ee61e51cb378288382

Andres Freund a poussé :

  • Don't skip SQL backends in logical decoding for visibility computation. The logical decoding patchset introduced PROC_IN_LOGICAL_DECODING flag PGXACT flag, that allows such backends to be skipped when computing the xmin horizon/snapshots. That's fine and sensible for walsenders streaming out logical changes, but not at all fine for SQL backends doing logical decoding. If the latter set that flag any change they have performed outside of logical decoding will not be regarded as visible - which e.g. can lead to that change being vacuumed away. Note that not setting the flag for SQL backends isn't particularly bothersome - the SQL backend doesn't do streaming, so it only runs for a limited amount of time. Per buildfarm member 'tick' and Alvaro. Backpatch to 9.4, where logical decoding was introduced. http://git.postgresql.org/pg/commitdiff/0fd38e13706e6bd4b2a4ce4e0570d0aa4ad65345
  • Document that pg_stat_*_tables.n_tup_upd includes n_tup_hot_upd. Author: Peter Geoghegan http://git.postgresql.org/pg/commitdiff/5ede3a31171d83b94a773d997fe05b563f8ebb3d

Peter Eisentraut a poussé :

Robert Haas a poussé :

Simon Riggs a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Jim Nasby sent in a patch to log cleanup lock acquisition failures in vacuum.
  • Tom Lane and Emre Hasegeli traded patches to add selectivity estimation for inet operators.
  • Dilip Kumar sent in another revision of a patch to allow vacuumdb to work in parallel.
  • Jeff Janes sent in a patch to attempt to fix startup/recovery problems with unlogged tables by adding an unconditional and unchecked unlink before the copy.
  • Jeff Davis sent in another revision of a patch to do better memory accounting.
  • SAWADA Masahiko and Michael Paquier traded patches to implement REINDEX SCHEMA.
  • Alexander Shulgin sent in another revision of a patch to turn recovery.conf into GUCs.
  • Craig Ringer and David Rowley traded patches to use the faster, higher precision timer API on Windows when available.
  • Teodor Sigaev sent in another revision of a patch to implement a compression method for SP-GiST.
  • Kaigai Kouhei sent in another revision of a patch to implement some interfaces in the custom scan API.
  • Peter Geoghegan sent in patches to: 1. add new abbreviation infrastructure to sortsupport, and add a single client of this new infrastructure, the text sortsupport routine. 2. Estimate total number of rows to be sorted, and 3. Alter comments to reflect current naming.
  • Matt Newell sent in two revisions of a patch to support pipelining in libpq.
  • Peter Geoghegan sent in another revision of a patch to create a Levenshtein distance column HINT for nonexistent columns.
  • Amit Kapila and David Rowley traded patches to do sequential scans in parallel.
  • Peter Geoghegan sent in a patch to clarify the documentation of pg_stat_all_tables to mention that pg_stat_*_tables.n_tup_upd includes HOT updates.
  • Heikki Linnakangas sent in another revision of a patch to implement an SSL regression test suite.
  • Michael Paquier sent in a patch to add missing descriptions for two parameters in XLOG_PARAMETER_CHANGE.
  • Petr (PJMODOS) Jelinek sent in a patch to rename action_at_recovery_target to recovery_target_action everywhere.
  • Michael Paquier sent in two more revisions of a patch to implement compression of full-pages writes.
  • Stephen Frost sent in a patch to change usage of GetUserId() to has_privs_of_role().
  • Stephen Frost sent in a patch to change the default for include_realm to zero.
  • Adam Brightwell sent in two more revisions of a patch to add a role attribute bitmask catalog representation.
  • Tomas Vondra sent in another revision of a patch to implement an adaptive ndistinct estimator.
  • Tomas Vondra sent in a patch to gracefully increasing NTUP_PER_BUCKET instead of batching.

par N Bougain le lundi 8 décembre 2014 à 21h36

lundi 1 décembre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 30 novembre 2014

Appel à conférenciers pour la PGCon 2015 lancé le 1er décembre 2014 : http://www.pgcon.org/2015/papers.php

Offres d'emplois autour de PostgreSQL en novembre

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é :

  • Distinguish XLOG_FPI records generated for hint-bit updates. Add a new XLOG_FPI_FOR_HINT record type, and use that for full-page images generated for hint bit updates, when checksums are enabled. The new record type is replayed exactly the same as XLOG_FPI, but allows them to be tallied separately e.g. in pg_xlogdump. http://git.postgresql.org/pg/commitdiff/0bd624d63b056205fda17a2d694d91db16468e3f
  • Add a few paragraphs to B-tree README explaining L&Y algorithm. This gives an overview of what Lehman & Yao's paper is all about, so that you can understand the rest of the README without having to read the paper. Per discussion with Peter Geoghegan and others. http://git.postgresql.org/pg/commitdiff/49b86fb1c97878ea2e3a8118df072c95f60077ac
  • Make Port->ssl_in_use available, even when built with !USE_SSL. Code that check the flag no longer need #ifdef's, which is more convenient. In particular, makes it easier to write extensions that depend on it. In the passing, modify sslinfo's ssl_is_used function to check ssl_in_use instead of the OpenSSL specific 'ssl' pointer. It doesn't make any difference currently, as sslinfo is only compiled when built with OpenSSL, but seems cleaner anyway. http://git.postgresql.org/pg/commitdiff/e453cc2741416dc784842b2bba68749556cf0f6f
  • Check return value of strdup() in libpq connection option parsing. An out-of-memory in most of these would lead to strange behavior, like connecting to a different database than intended, but some would lead to an outright segfault. Alex Shulgin and me. Backpatch to all supported versions. http://git.postgresql.org/pg/commitdiff/30bf4689a96cd283af33edcdd6b7210df3f20cd8
  • Allow "dbname" from connection string to be overridden in PQconnectDBParams If the "dbname" attribute in PQconnectDBParams contained a connection string or URI (and expand_dbname = TRUE), the database name from the connection string could not be overridden by a subsequent "dbname" keyword in the array. That was not intentional; all other options can be overridden. Furthermore, any subsequent "dbname" caused the connection string from the first dbname value to be processed again, overriding any values for the same options that were given between the connection string and the second dbname option. In the passing, clarify in the docs that only the first dbname option in the array is parsed as a connection string. Alex Shulgin. Backpatch to all supported versions. http://git.postgresql.org/pg/commitdiff/add1b052e2b2d5206474d58db25e48820242d15b
  • Allow using connection URI in primary_conninfo. The old method of appending options to the connection string didn't work if the primary_conninfo was a postgres:// style URI, instead of a traditional connection string. Use PQconnectdbParams instead. Alex Shulgin http://git.postgresql.org/pg/commitdiff/b3fc6727ce54a16ae9227bcccfebfa028ac5b16f
  • Remove dead function prototype. It was added in commit efc16ea5, but never defined. http://git.postgresql.org/pg/commitdiff/1812ee5767a25a36e7002be8a3a032357d3fe4e2
  • Fix assertion failure at end of PITR. InitXLogInsert() cannot be called in a critical section, because it allocates memory. But CreateCheckPoint() did that, when called for the end-of-recovery checkpoint by the startup process. In the passing, fix the scratch space allocation in InitXLogInsert to go to the right memory context. Also update the comment at InitXLOGAccess, which hasn't been totally accurate since hot standby was introduced (in a hot standby backend, InitXLOGAccess isn't called at backend startup). Reported by Michael Paquier http://git.postgresql.org/pg/commitdiff/afeacd274830d1e3d15ffc4e4d4b08a887f76abb

Tom Lane a poussé :

  • Allow simplification of EXISTS() subqueries containing LIMIT. The locution "EXISTS(SELECT ... LIMIT 1)" seems to be rather common among people who don't realize that the database already performs optimizations equivalent to putting LIMIT 1 in the sub-select. Unfortunately, this was actually making things worse, because it prevented us from optimizing such EXISTS clauses into semi or anti joins. Teach simplify_EXISTS_query() to suppress constant-positive LIMIT clauses. That fixes the semi/anti-join case, and may help marginally even for cases that have to be left as sub-SELECTs. Marti Raudsepp, reviewed by David Rowley http://git.postgresql.org/pg/commitdiff/b62f94c60386796fd88256c5b7b1e8301c345166
  • Support arrays as input to array_agg() and ARRAY(SELECT ...). These cases formerly failed with errors about "could not find array type for data type". Now they yield arrays of the same element type and one higher dimension. The implementation involves creating functions with API similar to the existing accumArrayResult() family. I (tgl) also extended the base family by adding an initArrayResult() function, which allows callers to avoid special-casing the zero-inputs case if they just want an empty array as result. (Not all do, so the previous calling convention remains valid.) This allowed simplifying some existing code in xml.c and plperl.c. Ali Akbar, reviewed by Pavel Stehule, significantly modified by me http://git.postgresql.org/pg/commitdiff/bac27394a1c69c20ec904729c593e59485c75c69
  • De-reserve most statement-introducing keywords in plpgsql. Add a bit of context sensitivity to plpgsql_yylex() so that it can recognize when the word it is looking at is the first word of a new statement, and if so whether it is the target of an assignment statement. When we are at start of statement and it's not an assignment, we can prefer recognizing unreserved keywords over recognizing variable names, thereby allowing most statements' initial keywords to be demoted from reserved to unreserved status. This is rather useful already (there are 15 such words that get demoted here), and what's more to the point is that future patches proposing to add new plpgsql statements can avoid objections about having to add new reserved words. The keywords BEGIN, DECLARE, FOR, FOREACH, LOOP, WHILE need to remain reserved because they can be preceded by block labels, and the logic added here doesn't understand about block labels. In principle we could probably fix that, but it would take more than one token of lookback and the benefit doesn't seem worth extra complexity. Also note I didn't de-reserve EXECUTE, because it is used in more places than just statement start. It's possible it could be de-reserved with more work, but that would be an independent fix. In passing, also de-reserve COLLATE and DEFAULT, which shouldn't have been reserved in the first place since they only need to be recognized within DECLARE sections. http://git.postgresql.org/pg/commitdiff/bb1b8f694ad2efc35ebae2acfa2c18a2197b82a1
  • Fix uninitialized-variable warning. In passing, add an Assert defending the presumption that bytes_left is positive to start with. (I'm not exactly convinced that using an unsigned type was such a bright thing here, but let's at least do this much.) http://git.postgresql.org/pg/commitdiff/d934a052348c1fa017ff677d08e74c643e3f416c
  • Free libxml2/libxslt resources in a safer order. Mark Simonetti reported that libxslt sometimes crashes for him, and that swapping xslt_process's object-freeing calls around to do them in reverse order of creation seemed to fix it. I've not reproduced the crash, but valgrind clearly shows a reference to already-freed memory, which is consistent with the idea that shutdown of the xsltTransformContext is trying to reference the already-freed stylesheet or input document. With this patch, valgrind is no longer unhappy. I have an inquiry in to see if this is a libxslt bug or if we're just abusing the library; but even if it's a library bug, we'd want to adjust our code so it doesn't fail with unpatched libraries. Back-patch to all supported branches, because we've been doing this in the wrong(?) order for a long time. http://git.postgresql.org/pg/commitdiff/c168ba311228c523923f7ef7699cba96deedcc6d
  • Improve typcache: cache negative lookup results, add invalidation logic. Previously, if the typcache had for example tried and failed to find a hash opclass for a given data type, it would nonetheless repeat the unsuccessful catalog lookup each time it was asked again. This can lead to a significant amount of useless bufmgr traffic, as in a recent report from Scott Marlowe. Like the catalog caches, typcache should be able to cache negative results. This patch arranges that by making use of separate flag bits to remember whether a particular item has been looked up, rather than treating a zero OID as an indicator that no lookup has been done. Also, install a credible invalidation mechanism, namely watching for inval events in pg_opclass. The sole advantage of the lack of negative caching was that the code would cope if operators or opclasses got added for a type mid-session; to preserve that behavior we have to be able to invalidate stale lookup results. Updates in pg_opclass should be pretty rare in production systems, so it seems sufficient to just invalidate all the dependent data whenever one happens. Adding proper invalidation also means that this code will now react sanely if an opclass is dropped mid-session. Arguably, that's a back-patchable bug fix, but in view of the lack of complaints from the field I'll refrain from back-patching. (Probably, in most cases where an opclass is dropped, the data type itself is dropped soon after, so that this misfeasance has no bad consequences.) http://git.postgresql.org/pg/commitdiff/e384ed6cdec691e0f7c9a077d0fb2a357763c335
  • Improve performance of OverrideSearchPathMatchesCurrent(). This function was initially coded on the assumption that it would not be performance-critical, but that turns out to be wrong in workloads that are heavily dependent on the speed of plpgsql functions. Speed it up by hard-coding the comparison rules, thereby avoiding palloc/pfree traffic from creating and immediately freeing an OverrideSearchPath object. Per report from Scott Marlowe. http://git.postgresql.org/pg/commitdiff/96d66bcfc60d9bcb7db767f23d33abf4d8bc7021
  • Add bms_next_member(), and use it where appropriate. This patch adds a way of iterating through the members of a bitmapset nondestructively, unlike the old way with bms_first_member(). While bms_next_member() is very slightly slower than bms_first_member() (at least for typical-size bitmapsets), eliminating the need to palloc and pfree a temporary copy of the target bitmapset is a significant win. So this method should be preferred in all cases where a temporary copy would be necessary. Tom Lane, with suggestions from Dean Rasheed and David Rowley http://git.postgresql.org/pg/commitdiff/f4e031c662a6b600b786c4849968a099c58fcce7
  • Add bms_get_singleton_member(), and use it where appropriate. This patch adds a function that replaces a bms_membership() test followed by a bms_singleton_member() call, performing both the test and the extraction of a singleton set's member in one scan of the bitmapset. The performance advantage over the old way is probably minimal in current usage, but it seems worthwhile on notational grounds anyway. David Rowley http://git.postgresql.org/pg/commitdiff/d25367ec4f869aac80e97964fa5d7143536818b1
  • Fix minor bugs in commit 30bf4689a96cd283af33edcdd6b7210df3f20cd8 et al. Coverity complained that the "else" added to fillPGconn() was unreachable, which it was. Remove the dead code. In passing, rearrange the tests so as not to bother trying to fetch values for options that can't be assigned. Pre-9.3 did not have that issue, but it did have a "return" that should be "goto oom_error" to ensure that a suitable error message gets filled in. http://git.postgresql.org/pg/commitdiff/1adbb347ec6ca059168a1866357ca7a23d117272

Stephen Frost a poussé :

  • Suppress DROP CASCADE notices in regression tests. In the regression tests, when doing cascaded drops, we need to suppress the notices from DROP CASCADE or there can be transient regression failures as the order of drops can depend on the physical row order in pg_depend. Report and fix suggestion from Tom. http://git.postgresql.org/pg/commitdiff/81d815dc3ed74a7d20f7b4c7d87c42816c7ee7af
  • Add int64 -> int8 mapping to genbki. Per discussion with Tom and Andrew, 64bit integers are no longer a problem for the catalogs, so go ahead and add the mapping from the C int64 type to the int8 SQL identification to allow using them. Patch by Adam Brightwell http://git.postgresql.org/pg/commitdiff/25976710dfd8611d3fc79c0c1e20179ff7a940ec
  • Rename pg_rowsecurity -> pg_policy and other fixes As pointed out by Robert, we should really have named pg_rowsecurity pg_policy, as the objects stored in that catalog are policies. This patch fixes that and updates the column names to start with 'pol' to match the new catalog name. The security consideration for COPY with row level security, also pointed out by Robert, has also been addressed by remembering and re-checking the OID of the relation initially referenced during COPY processing, to make sure it hasn't changed under us by the time we finish planning out the query which has been built. Robert and Alvaro also commented on missing OCLASS and OBJECT entries for POLICY (formerly ROWSECURITY or POLICY, depending) in various places. This patch fixes that too, which also happens to add the ability to COMMENT on policies. In passing, attempt to improve the consistency of messages, comments, and documentation as well. This removes various incarnations of 'row-security', 'row-level security', 'Row-security', etc, in favor of 'policy', 'row level security' or 'row_security' as appropriate. Happy Thanksgiving! http://git.postgresql.org/pg/commitdiff/143b39c1855f8a22f474f20354ee5ee5d2f4d266

Simon Riggs a poussé :

Robert Haas a poussé :

Peter Eisentraut a poussé :

Fujii Masao a poussé :

Álvaro Herrera a poussé :

Noah Misch a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Dilip Kumar sent in another revision of a patch to allow doing vacuumdb in parallel.
  • Amit Langote sent in a patch to fix a typo in a comment in src/bin/pg_dump.c.
  • Álvaro Herrera sent in another revision of a patch to track commit timestamps.
  • Michael Paquier and Rahila Syed traded patches to improve compression of full-page writes.
  • Adam Brightwell sent in two more revisions of a patch to implement role attribute bitmask catalog representation.
  • Ali Akbar sent in another revision of a patch to fix xpath() to return namespace definitions.
  • Marius Timmer sent in a patch to add an option to EXPLAIN to include sort order information in VERBOSE mode.
  • Michael Paquier sent in two revisions of a patch to allow compiling C++ extensions on MSVC using scripts in src/tools.
  • Ants Aasma sent in a patch to use RTLD_DEEPBIND to handle symbol conflicts in loaded libraries.
  • Pavel Stehule sent in another revision of a patch to add an ASSERT statement to PL/pgsql.
  • Peter Geoghegan sent in another revision of a patch to implement INSERT ... ON CONFLICT {IGNORE | UPDATE}.
  • Alexander Shulgin sent in another revision of a patch to add an 'ssl_protocols' configuration option.
  • Álvaro Herrera sent in a flock of patches to move test modules from contrib to src/test/modules.
  • Mats Erik Andersson sent in a patch to improve error recovery in initdb when the password file is empty.
  • Mats Erik Andersson sent in a patch to localize the text response of pg_isready.
  • Ian Lawrence Barwick sent in a patch to implement DDL deparsing.
  • Michael Paquier sent in another revision of a patch to implement fillfactor for GIN indexes.
  • Alexander Shulgin sent in a patch to allow TOAST tables to be moved to a different tablespace.
  • Peter Eisentraut sent in a patch to allow using Core Foundation locale functions on OSX.
  • Tom Lane sent in a patch to fix some misleading error messages in json_to_record.
  • Michael Paquier sent in a patch to add a new error code to track unsupported contexts.
  • Tomas Vondra sent in another revision of a patch to lower array_agg's memory requirements.
  • Stephen Frost sent in another revision of a patch to clean up GetUserId() for pg_stat and pg_signal.
  • Noah Misch sent in another revision of a patch to help secure "make check".
  • David Rowley sent in a patch to allow removing inner JOINs in some cases.
  • Andrew Dunstan sent in a patch to fix the check for whether something is considered a number in JSON.
  • Ian Lawrence Barwick sent in a patch to fix a typo/spacing problem in doc/src/sgml/wal.sgml.

par N Bougain le lundi 1 décembre 2014 à 22h03

mardi 25 novembre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 23 novembre 2014

PostgreSQL 9.4RC1 disponible. Test ! https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.4

L'appel à conférenciers pour le PGDay et la Devroom du FOSDEM 2015 est lancé : http://fosdem2015.pgconf.eu/callforpapers/

La pgcon japonaise 2014 aura lieu le 5 décembre à Shinagawa : http://www.postgresql.jp/events/jpug-pgcon2014

pgDaySF 2015 aura lieu le 10 mars 2015 à Burlingame (Californie) : http://sfpostgres.org/pgday-sf-2015-call-for-speakers-and-sponsors/

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en novembre

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

Álvaro Herrera a poussé :

  • Fix relpersistence setting in reindex_index. Buildfarm members with CLOBBER_CACHE_ALWAYS advised us that commit 85b506bbfc2937 was mistaken in setting the relpersistence value of the index directly in the relcache entry, within reindex_index. The reason for the failure is that an invalidation message that comes after mucking with the relcache entry directly, but before writing it to the catalogs, would cause the entry to become rebuilt in place from catalogs with the old contents, losing the update. Fix by passing the correct persistence value to RelationSetNewRelfilenode instead; this routine also writes the updated tuple to pg_class, avoiding the problem. Suggested by Tom Lane. http://git.postgresql.org/pg/commitdiff/0f9692b40d1292f1b2640f026561908fd37b7407

Heikki Linnakangas a poussé :

  • Fix WAL-logging of B-tree "unlink halfdead page" operation. There was some confusion on how to record the case that the operation unlinks the last non-leaf page in the branch being deleted. _bt_unlink_halfdead_page set the "topdead" field in the WAL record to the leaf page, but the redo routine assumed that it would be an invalid block number in that case. This commit fixes _bt_unlink_halfdead_page to do what the redo routine expected. This code is new in 9.4, so backpatch there. http://git.postgresql.org/pg/commitdiff/c73669c0e0168923e3f9e787beec980f55af2bd8
  • Remove obsolete debugging option, RTDEBUG. The r-tree AM that used it was removed back in 2005. Peter Geoghegan http://git.postgresql.org/pg/commitdiff/dedae6c211415290cdf5faca4ef874f803af204c
  • Add test cases for indexam operations not currently covered. That includes VACUUM on GIN, GiST and SP-GiST indexes, and B-tree indexes large enough to cause page deletions in B-tree. Plus some other special cases. After this patch, the regression tests generate all different WAL record types. Not all branches within the redo functions are covered, but it's a step forward. http://git.postgresql.org/pg/commitdiff/88fc71926392115cdc3672807f3903ce43d0ebcf
  • Silence compiler warning about variable being used uninitialized. It's a false positive - the variable is only used when 'onleft' is true, and it is initialized in that case. But the compiler doesn't necessarily see that. http://git.postgresql.org/pg/commitdiff/f464042161fb980578c33fedc2742c5a4d941fa2
  • Revamp the WAL record format. Each WAL record now carries information about the modified relation and block(s) in a standardized format. That makes it easier to write tools that need that information, like pg_rewind, prefetching the blocks to speed up recovery, etc. There's a whole new API for building WAL records, replacing the XLogRecData chains used previously. The new API consists of XLogRegister* functions, which are called for each buffer and chunk of data that is added to the record. The new API also gives more control over when a full-page image is written, by passing flags to the XLogRegisterBuffer function. This also simplifies the XLogReadBufferForRedo() calls. The function can dig the relation and block number from the WAL record, so they no longer need to be passed as arguments. For the convenience of redo routines, XLogReader now disects each WAL record after reading it, copying the main data part and the per-block data into MAXALIGNed buffers. The data chunks are not aligned within the WAL record, but the redo routines can assume that the pointers returned by XLogRecGet* functions are. Redo routines are now passed the XLogReaderState, which contains the record in the already-disected format, instead of the plain XLogRecord. The new record format also makes the fixed size XLogRecord header smaller, by removing the xl_len field. The length of the "main data" portion is now stored at the end of the WAL record, and there's a separate header after XLogRecord for it. The alignment padding at the end of XLogRecord is also removed. This compansates for the fact that the new format would otherwise be more bulky than the old format. Reviewed by Andres Freund, Amit Kapila, Michael Paquier, Alvaro Herrera, Fujii Masao. http://git.postgresql.org/pg/commitdiff/2c03216d831160bedd72d45f712601b6f7d03f1c
  • Add pageinspect functions for inspecting GIN indexes. Patch by me, Peter Geoghegan and Michael Paquier, reviewed by Amit Kapila. http://git.postgresql.org/pg/commitdiff/3a82bc6f8ab38be3ed095f1c86866900b145f0f6
  • Fix bogus comments in XLogRecordAssemble. Pointed out by Michael Paquier http://git.postgresql.org/pg/commitdiff/8f5dcb56cb1877f7ed6b0f3f72cc26c4e060aa61
  • Add a comment to regress.c explaining what it contains. Ian Barwick http://git.postgresql.org/pg/commitdiff/b10a97b819a2594c97188bac02d87b550908a692
  • No need to call XLogEnsureRecordSpace when the relation is unlogged. Amit Kapila http://git.postgresql.org/pg/commitdiff/622983ea6964fc55f1ad3063d3d7b8f5de8e8816

Tom Lane a poussé :

  • Update time zone data files to tzdata release 2014j. DST law changes in the Turks & Caicos Islands (America/Grand_Turk) and in Fiji. New zone Pacific/Bougainville for portions of Papua New Guinea. Historical changes for Korea and Vietnam. http://git.postgresql.org/pg/commitdiff/bc241488b0f9bde3e14094bfaf0d7987fafb6600
  • Update 9.4 release notes for commits through today. http://git.postgresql.org/pg/commitdiff/832054044f68080eaebccd771e21fdd56824db20
  • Fix some bogus direct uses of realloc(). pg_dump/parallel.c was using realloc() directly with no error check. While the odds of an actual failure here seem pretty low, Coverity complains about it, so fix by using pg_realloc() instead. While looking for other instances, I noticed a couple of places in psql that hadn't gotten the memo about the availability of pg_realloc. These aren't bugs, since they did have error checks, but verbosely inconsistent code is not a good thing. Back-patch as far as 9.3. 9.2 did not have pg_dump/parallel.c, nor did it have pg_realloc available in all frontend code. http://git.postgresql.org/pg/commitdiff/8b13e5c6c0e8a6b797370fb91d207031df5e784a
  • Update comments in find_typedef. These comments don't seem to have been touched in a long time. Make them describe the current implementation rather than what was here last century, and be a bit more explicit about the unreferenced-typedefs issue. http://git.postgresql.org/pg/commitdiff/7aa8d9e56c18b1df9d924f144c06d921131a137e
  • Don't require bleeding-edge timezone data in timestamptz regression test. The regression test cases added in commits b2cbced9e et al depended in part on the Russian timezone offset changes of Oct 2014. While this is of no particular concern for a default Postgres build, it was possible for a build using --with-system-tzdata to fail the tests if the system tzdata database wasn't au courant. Bjorn Munch and Christoph Berg both complained about this while packaging 9.4rc1, so we probably shouldn't insist on the system tzdata being up-to-date. Instead, make an equivalent test using a zone change that occurred in Venezuela in 2007. With this patch, the regression tests should pass using any tzdata set from 2012 or later. (I can't muster much sympathy for somebody using --with-system-tzdata on a machine whose system tzdata is more than three years out-of-date.) http://git.postgresql.org/pg/commitdiff/8d7af8fbe7349cbebb576459c9b5f54dfcc6216a
  • Improve documentation's description of JOIN clauses. In bug #12000, Andreas Kunert complained that the documentation was misleading in saying "FROM T1 CROSS JOIN T2 is equivalent to FROM T1, T2". That's correct as far as it goes, but the equivalence doesn't hold when you consider three or more tables, since JOIN binds more tightly than comma. I added a <note> to explain this, and ended up rearranging some of the existing text so that the note would make sense in context. In passing, rewrite the description of JOIN USING, which was unnecessarily vague, and hadn't been helped any by somebody's reliance on markup as a substitute for clear writing. (Mostly this involved reintroducing a concrete example that was unaccountably removed by commit 032f3b7e166cfa28.) Back-patch to all supported branches. http://git.postgresql.org/pg/commitdiff/8372304e3594a1d67737df779f098d9ae9937603
  • Add missing case for CustomScan. Per KaiGai Kohei. In passing improve formatting of some code added in commit 30d7ae3c, because otherwise pgindent will make a mess of it. http://git.postgresql.org/pg/commitdiff/f9e0255c6fbedda50aae6aa7479f0c5a8f90b831
  • Remove no-longer-needed phony typedefs in genbki.h. Now that we have a policy of hiding varlena catalog fields behind "#ifdef CATALOG_VARLEN", there is no need for their type names to be acceptable to the C compiler. And experimentation shows that it does not matter to pgindent either. (If it did, we'd have problems anyway, since these typedefs are unreferenced so far as the C compiler is concerned, and find_typedef fails to identify such typedefs.) Hence, remove the phony typedefs that genbki.h provided to make some varlena field definitions compilable. In passing, rearrange #define's into what seemed a more logical order. http://git.postgresql.org/pg/commitdiff/c5111ea9ca049a650b63cdcb2551c330c2f998b1
  • Fix another oversight in CustomScan patch. disuse_physical_tlist() must work for all plan types handled by create_scan_plan(). http://git.postgresql.org/pg/commitdiff/03e574af5f5d4682ce3ae6dc401ba126c70ce2ea
  • Fix another oversight in CustomScan patch. execCurrent.c's search_plan_tree() must recognize a CustomScan on the target relation. This would only be helpful for custom providers that support CurrentOfExpr quals, which is probably a bit far-fetched, but it's not impossible I think. But even without assuming that, we need to recognize a scanned-relation match so that we will properly throw error if the desired relation is being scanned with both a CustomScan and a regular scan (ie, self-join). Also recognize ForeignScanState for similar reasons. Supporting WHERE CURRENT OF on a foreign table is probably even more far-fetched than it is for custom scans, but I think in principle you could do it with postgres_fdw (or another FDW that supports the ctid column). This would be a back-patchable bug fix if existing FDWs handled CurrentOfExpr, but I doubt any do so I won't bother back-patching. http://git.postgresql.org/pg/commitdiff/081a6048cff07a83591ebcb08b676a771ae58d2b
  • Initial code review for CustomScan patch. Get rid of the pernicious entanglement between planner and executor headers introduced by commit 0b03e5951bf0a1a8868db13f02049cf686a82165. Also, rearrange the CustomFoo struct/typedef definitions so that all the typedef names are seen as used by the compiler. Without this pgindent will mess things up a bit, which is not so important perhaps, but it also removes a bizarre discrepancy between the declaration arrangement used for CustomExecMethods and that used for CustomScanMethods and CustomPathMethods. Clean up the commentary around ExecSupportsMarkRestore to reflect the rather large change in its API. Const-ify register_custom_path_provider's argument. This necessitates casting away const in the function, but that seems better than forcing callers of the function to do so (or else not const-ify their method pointer structs, which was sort of the whole point). De-export fix_expr_common. I don't like the exporting of fix_scan_expr or replace_nestloop_params either, but this one surely has got little excuse. http://git.postgresql.org/pg/commitdiff/a34fa8ee7cc757671632dc4dcae4f21e8f2e2357
  • Remove dead code supporting mark/restore in SeqScan, TidScan, ValuesScan. There seems no prospect that any of this will ever be useful, and indeed it's questionable whether some of it would work if it ever got called; it's certainly not been exercised in a very long time, if ever. So let's get rid of it, and make the comments about mark/restore in execAmi.c less wishy-washy. The mark/restore support for Result nodes is also currently dead code, but that's due to planner limitations not because it's impossible that it could be useful. So I left it in. http://git.postgresql.org/pg/commitdiff/adbfab119b308a7e0e6b1305de9be222cfd5c85b
  • Simplify API for initially hooking custom-path providers into the planner. Instead of register_custom_path_provider and a CreateCustomScanPath callback, let's just provide a standard function hook in set_rel_pathlist. This is more flexible than what was previously committed, is more like the usual conventions for planner hooks, and requires less support code in the core. We had discussed this design (including centralizing the set_cheapest() calls) back in March or so, so I'm not sure why it wasn't done like this already. http://git.postgresql.org/pg/commitdiff/c2ea2285e978d9289084846a3343cef7d261d880
  • Rearrange CustomScan API. Make it work more like FDW plans do: instead of assuming that there are expressions in a CustomScan plan node that the core code doesn't know about, insist that all subexpressions that need planner attention be in a "custom_exprs" list in the Plan representation. (Of course, the custom plugin can break the list apart again at executor initialization.) This lets us revert the parts of the patch that exposed setrefs.c and subselect.c processing to the outside world. Also revert the GetSpecialCustomVar stuff in ruleutils.c; that concept may work in future, but it's far from fully baked right now. http://git.postgresql.org/pg/commitdiff/447770404cce5ce86174fa4809784c4e5d0a0a76
  • Fix mishandling of system columns in FDW queries. postgres_fdw would send query conditions involving system columns to the remote server, even though it makes no effort to ensure that system columns other than CTID match what the remote side thinks. tableoid, in particular, probably won't match and might have some use in queries. Hence, prevent sending conditions that include non-CTID system columns. Also, create_foreignscan_plan neglected to check local restriction conditions while determining whether to set fsSystemCol for a foreign scan plan node. This again would bollix the results for queries that test a foreign table's tableoid. Back-patch the first fix to 9.3 where postgres_fdw was introduced. Back-patch the second to 9.2. The code is probably broken in 9.1 as well, but the patch doesn't apply cleanly there; given the weak state of support for FDWs in 9.1, it doesn't seem worth fixing. Etsuro Fujita, reviewed by Ashutosh Bapat, and somewhat modified by me http://git.postgresql.org/pg/commitdiff/9c58101117d25f174c8d8013befdc33c632922d0
  • Get rid of redundant production in plpgsql grammar. There may once have been a reason for the intermediate proc_stmts production in the plpgsql grammar, but it isn't doing anything useful anymore, so let's collapse it into proc_sect. Saves some code and probably a small number of nanoseconds per statement list. In passing, correctly alphabetize keyword lists to match pl_scanner.c; note that for "rowtype" vs "row_count", pl_scanner.c must sort on the basis of the lower-case spelling. Noted while fooling with a patch to de-reserve more plpgsql keywords. http://git.postgresql.org/pg/commitdiff/e2dc3f57726199408902ba87eaaf7b95d1223744

Fujii Masao a poussé :

  • Add --synchronous option to pg_receivexlog, for more reliable WAL writing. Previously pg_receivexlog flushed WAL data only when WAL file was switched. Then 3dad73e added -F option to pg_receivexlog so that users could control how frequently sync commands were issued to WAL files. It also allowed users to make pg_receivexlog flush WAL data immediately after writing by specifying 0 in -F option. However feedback messages were not sent back immediately even after a flush location was updated. So even if WAL data was flushed in real time, the server could not see that for a while. This commit removes -F option from and adds --synchronous to pg_receivexlog. If --synchronous is specified, like the standby's wal receiver, pg_receivexlog flushes WAL data as soon as there is WAL data which has not been flushed yet. Then it sends back the feedback message identifying the latest flush location to the server. This option is useful to make pg_receivexlog behave as sync standby by using replication slot, for example. Original patch by Furuya Osamu, heavily rewritten by me. Reviewed by Heikki Linnakangas, Alvaro Herrera and Sawada Masahiko. http://git.postgresql.org/pg/commitdiff/c4f99d20294950576d552dcaf9ce5b9bdc4233a3
  • Fix pg_receivexlog --slot so that it doesn't prevent the server shutdown. When pg_receivexlog --slot is connecting to the server, at the shutdown of the server, walsender keeps waiting for the last WAL record to be replicated and flushed in pg_receivexlog. But previously pg_receivexlog issued sync command only when WAL file was switched. So there was the case where the last WAL was never flushed and walsender had to keep waiting infinitely. This caused the server shutdown to get stuck. pg_recvlogical handles this problem by calling fsync() when it receives the request of immediate reply from the server. That is, at shutdown, walsender sends the request, pg_recvlogical receives it, flushes the last WAL record, and sends the flush location back to the server. Since walsender can see that the last WAL record is successfully flushed, it can exit cleanly. This commit introduces the same logic as pg_recvlogical has, to pg_receivexlog. Back-patch to 9.4 where pg_receivexlog was changed so that it can use the replication slot. Original patch by Michael Paquier, rewritten by me. Bug report by Furuya Osamu. http://git.postgresql.org/pg/commitdiff/f66c20b317578838a39a1de8014c4363bdc98b9a
  • Fix bug in the test of file descriptor of current WAL file in pg_receivexlog. In pg_receivexlog, in order to check whether the current WAL file is being opened or not, its file descriptor has to be checked against -1 as an invalid value. But, oops, 7900e94 added the incorrect test checking the descriptor against 1. This commit fixes that bug. Back-patch to 9.4 where the bug was added. Spotted by Magnus Hagander http://git.postgresql.org/pg/commitdiff/d5f4df7264ec73abda41eb78b81cf430b33f7606

Simon Riggs a poussé :

  • Add pg_dump --snapshot option. Allows pg_dump to use a snapshot previously defined by a concurrent session that has either used pg_export_snapshot() or obtained a snapshot when creating a logical slot. When this option is used with parallel pg_dump, the snapshot defined by this option is used and no new snapshot is taken. Simon Riggs and Michael Paquier http://git.postgresql.org/pg/commitdiff/be1cc8f46f57a04e69d9e4dd268d34da885fe6eb
  • Reduce btree scan overhead for < and > strategies. For <, <=, > and >= strategies, mark the first scan key as already matched if scanning in an appropriate direction. If index tuple contains no nulls we can skip the first Author: Rajeev Rastogi. Reviewer: Haribabu Kommi. Rework of the code and comments by Simon Riggs http://git.postgresql.org/pg/commitdiff/606c0123d627b37d5ac3f7c2c97cd715dde7842f

Robert Haas a poussé :

Peter Eisentraut a poussé :

Andrew Dunstan a poussé :

Noah Misch a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Etsuro Fujita sent in another revision of a patch to allow foreign tables to participate in table inheritance hierarchies.
  • Jeff Davis and Tomas Vondra traded patches to do better memory accounting, in part as infrastructure for a memory-bounded HashAgg.
  • Michael Paquier sent in a patch to fix CLOBBER_CACHE_ALWAYS.
  • Michael Paquier sent in another revision of a patch to track number of files marked as ready for archiving in pg_stat_archiver.
  • SAWADA Masahiko sent in another revision of a patch to implement REINDEX SCHEMA, in this case as an option to reindexdb.
  • Heikki Linnakangas sent in two PoC patches to deal with a performance problem in PageRepairFragmentation.
  • Petr (PJMODOS) Jelinek and Simon Riggs traded patches to add a shutdown_at_recovery_target option to recovery.conf.
  • Dimitri Fontaine sent in three more revisions of a patch to add "table rewrite" as an event which can fire an event trigger.
  • Adam Brightwell sent in a patch to add int64-to-int8 mapping in Catalog.pm.
  • Magnus Hagander sent in another revision of a patch to add a pg_stat_ssl view.
  • Aaron W. Swenson sent in a patch to replace configure.in with configure dot ac.
  • Heikki Linnakangas sent in a patch to add some more tests for WALs.
  • Peter Geoghegan sent in two revisions of a patch to create an amcheck utility, a generalization of his previous btreecheck.
  • Michael Paquier sent in a patch to uppercase some SQL keywords in the BRIN documents.
  • Amit Kapila sent in another revision of a patch to fix some infelicities between pg_basebackup and Windows.
  • Peter Eisentraut sent in a series of patches which: Fix SHLIB_PREREQS use in contrib, allowing PGXS builds, allow the user to set VPATH directly, and clean up some makefile changes that weren't needed.
  • Abhijit Menon-Sen sent in a patch to use slice-by-8 for CRC, which increased the performance of that operation by a factor of 4+.
  • Adam Brightwell sent in another revision of a patch to fix Catalog.pm for role attributes.
  • Laurenz Albe sent in a patch to disallow changing functions which are part of an index definition.
  • Michael Paquier sent in a patch to enable GIN code managing entry insertion not to distinguish fresh from old indexes.
  • Robert Haas sent in another revision of a patch to add infrastructure to save and restore GUC values.
  • Michael Paquier sent in a patch to add fillfactor as storage parameter for GIN indexes.
  • Petr (PJMODOS) Jelinek sent in two more revisions of a patch to track commit timestamps.
  • Adam Brightwell sent in another revision of a patch to clean up superuser shortcuts.
  • Alexander Shulgin sent in another revision of a patch to turn recovery.conf into GUCs.
  • Álvaro Herrera added some opfamilies for BRIN indexes which should help make them more useful.
  • Marko (johto) Tiikkaja sent in two revisions of a patch to make the HINTs more useful for certain types common mistakes in UPDATE.
  • Amit Kapila sent in another revision of a patch to parallelize vacuumdb.
  • David Rowley sent in another revision of a patch to support SEMI and ANTI join removal in certain cases.
  • Tom Lane sent in a patch to remove 17 of PL/pgsql's reserved words.

par N Bougain le mardi 25 novembre 2014 à 00h35

vendredi 21 novembre 2014

Actualités PostgreSQL.fr

Publication de PostgreSQL 9.4 RC1

Le PostgreSQL Global Development Group a publié la version 9.4 RC1.

Il s'agit de la première Release Candidate pour la prochaine version de PostgreSQL.
Cette version devrait être identique à la version finale de PostgreSQL 9.4, à l'exception des éventuels bogues rencontrés dans les deux prochaines semaines.

Merci de la télécharger et de la tester, et au besoin de rapporter les failles rencontrées.

La liste complète des fonctionnalités de la version 9.4 est disponible sur la page des notes de version : http://www.postgresql.org/docs/devel/static/release-9-4.html.

Les descriptions détaillées et les notes complémentaires concernant les nouvelles fonctionnalités sont disponibles sur la page Wiki des fonctionnalités de la version 9.4 : http://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.4

Nous dépendons des tests de la communauté pour garantir que cette version est réellement performante et exempte de bogues.
Merci de télécharger la RC1 et de la tester dès que possible en conditions opérationnelles réelles. Vos retours et critiques sont indispensables aux développeurs.
Les fonctionnalités et API de cette RC1 sont identiques à la 9.4.0 finale, ce qui permet de construire et tester les applications avec celles-là.

Plus d'informations sur la façon de tester et de rapporter les problèmes sur la page suivante :
http://www.postgresql.org/developer/beta.

PostgreSQL 9.4 RC1 peut être obtenu en se rendant sur la page :
http://www.postgresql.org/download
Cette page inclut les binaires et installeurs pour Windows, Linux et Mac.

La documentation complète de la nouvelle version est disponible en ligne :
http://www.postgresql.org/docs/devel/static, et s'installe également avec PostgreSQL.

par SAS le vendredi 21 novembre 2014 à 11h39

mardi 18 novembre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 16 novembre 2014

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/

Offres d'emplois autour de PostgreSQL en novembre

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

Bruce Momjian a poussé :

Robert Haas a poussé :

Kevin Grittner a poussé :

Álvaro Herrera a poussé :

  • Further code and wording tweaks in BRIN. Besides a couple of typo fixes, per David Rowley, Thom Brown, and Amit Langote, and mentions of BRIN in the general CREATE INDEX page again per David, this includes silencing MSVC compiler warnings (thanks Microsoft) and an additional variable initialization per Coverity scanner. http://git.postgresql.org/pg/commitdiff/1e0b4365c22c9f8a1bc7a5f8339f770c767b402f
  • BRIN: fix bug in xlog backup block counting. The code that generates the BRIN_XLOG_UPDATE removes the buffer reference when the page that's target for the updated tuple is freshly initialized. This is a pretty usual optimization, but was breaking the case where the revmap buffer, which is referenced in the same WAL record, is getting a backup block: the replay code was using backup block index 1, which is not valid when the update target buffer gets pruned; the revmap buffer gets assigned 0 instead. Make sure to use the correct backup block index for revmap when replaying. Bug reported by Fujii Masao. http://git.postgresql.org/pg/commitdiff/a590f266e44c492d2a252ab9dee0cd88dbe06dc5
  • Tweak row-level locking documentation. Move the meat of locking levels to mvcc.sgml, leaving only a link to it in the SELECT reference page. Michael Paquier, with some tweaks by Álvaro http://git.postgresql.org/pg/commitdiff/35fed51626328a3ff54adae4749bef956e1e1099
  • Allow interrupting GetMultiXactIdMembers. This function has a loop which can lead to uninterruptible process "stalls" (actually infinite loops) when some bugs are triggered. Avoid that unpleasant situation by adding a check for interrupts in a place that shouldn't degrade performance in the normal case. Backpatch to 9.3. Older branches have an identical loop here, but the aforementioned bugs are only a problem starting in 9.3 so there doesn't seem to be any point in backpatching any further. http://git.postgresql.org/pg/commitdiff/51f9ea25dc4296948eb851a851bb60e0860c70a1
  • Reduce disk footprint of brin regression test. Per complaint from Tom Lane. While at it, throw in some extra tests for nulls as well, and make sure that the set of data we insert on the second round is not identical to the first one. Both measures are intended to improve coverage of the test. Also uncomment the ON COMMIT DROP clause on the CREATE TEMP TABLE commands. This doesn't have any effect for someone examining the regression database after the tests are done, but it reduces clutter for those that execute the script directly. http://git.postgresql.org/pg/commitdiff/86cf9a565069755189e08290343d2d62afdd1f52
  • Document BRIN's pages_per_range in CREATE INDEX. Author: Michael Paquier http://git.postgresql.org/pg/commitdiff/79172a58ea3e858750c93c61d55411a209c5ac69
  • Remove unused InhPaths. Allegedly, the last remaining usages of that struct were removed by 0e99be1c. Author: Peter Geoghegan http://git.postgresql.org/pg/commitdiff/e4d1e264918f4019c86c807e7c349658f7a10397
  • postgres_fdw.h: don't pull in rel.h when relcache.h is enough. http://git.postgresql.org/pg/commitdiff/f9ef578d050c509d0f4bc02b3c0a3a0497056a2a
  • Get rid of SET LOGGED indexes persistence kludge. This removes ATChangeIndexesPersistence() introduced by f41872d0c1239d36 which was too ugly to live for long. Instead, the correct persistence marking is passed all the way down to reindex_index, so that the transient relation built to contain the index relfilenode can get marked correctly right from the start. Author: Fabrízio de Royes Mello. Review and editorialization by Michael Paquier and Álvaro Herrera http://git.postgresql.org/pg/commitdiff/85b506bbfc2937c9abdfcce4e01a8feca8e64ee8

Tom Lane a poussé :

  • Ensure that RowExprs and whole-row Vars produce the expected column names. At one time it wasn't terribly important what column names were associated with the fields of a composite Datum, but since the introduction of operations like row_to_json(), it's important that looking up the rowtype ID embedded in the Datum returns the column names that users would expect. That did not work terribly well before this patch: you could get the column names of the underlying table, or column aliases from any level of the query, depending on minor details of the plan tree. You could even get totally empty field names, which is disastrous for cases like row_to_json(). To fix this for whole-row Vars, look to the RTE referenced by the Var, and make sure its column aliases are applied to the rowtype associated with the result Datums. This is a tad scary because we might have to return a transient RECORD type even though the Var is declared as having some named rowtype. In principle it should be all right because the record type will still be physically compatible with the named rowtype; but I had to weaken one Assert in ExecEvalConvertRowtype, and there might be third-party code containing similar assumptions. Similarly, RowExprs have to be willing to override the column names coming from a named composite result type and produce a RECORD when the column aliases visible at the site of the RowExpr differ from the underlying table's column names. In passing, revert the decision made in commit 398f70ec070fe601 to add an alias-list argument to ExecTypeFromExprList: better to provide that functionality in a separate function. This also reverts most of the code changes in d68581483564ec0f, which we don't need because we're no longer depending on the tupdesc found in the child plan node's result slot to be blessed. Back-patch to 9.4, but not earlier, since this solution changes the results in some cases that users might not have realized were buggy. We'll apply a more restricted form of this patch in older branches. http://git.postgresql.org/pg/commitdiff/bf7ca15875988a88e97302e012d7c4808bef3ea9
  • Fix dependency searching for case where column is visited before table. When the recursive search in dependency.c visits a column and then later visits the whole table containing the column, it needs to propagate the drop-context flags for the table to the existing target-object entry for the column. Otherwise we might refuse the DROP (if not CASCADE) on the incorrect grounds that there was no automatic drop pathway to the column. Remarkably, this has not been reported before, though it's possible at least when an extension creates both a datatype and a table using that datatype. Rather than just marking the column as allowed to be dropped, it might seem good to skip the DROP COLUMN step altogether, since the later DROP of the table will surely get the job done. The problem with that is that the datatype would then be dropped before the table (since the whole situation occurred because we visited the datatype, and then recursed to the dependent column, before visiting the table). That seems pretty risky, and the case is rare enough that it doesn't seem worth expending a lot of effort or risk to make the drops happen in a safe order. So we just play dumb and delete the column separately according to the existing drop ordering rules. Per report from Petr Jelinek, though this is different from his proposed patch. Back-patch to 9.1, where extensions were introduced. There's currently no evidence that such cases can arise before 9.1, and in any case we would also need to back-patch cb5c2ba2d82688d29b5902d86b993a54355cad4d to 9.0 if we wanted to back-patch this. http://git.postgresql.org/pg/commitdiff/2edfc021c64ac2b15c9e9f9ada037ad12150bfa9
  • Loop when necessary in contrib/pgcrypto's pktreader_pull(). This fixes a scenario in which pgp_sym_decrypt() failed with "Wrong key or corrupt data" on messages whose length is 6 less than a power of 2. Per bug #11905 from Connor Penhale. Fix by Marko Tiikkaja, regression test case from Jeff Janes. http://git.postgresql.org/pg/commitdiff/f2ad2bdd0abfb1ce8f274fbb01a82e209f4cc122
  • Explicitly support the case that a plancache's raw_parse_tree is NULL. This only happens if a client issues a Parse message with an empty query string, which is a bit odd; but since it is explicitly called out as legal by our FE/BE protocol spec, we'd probably better continue to allow it. Fix by adding tests everywhere that the raw_parse_tree field is passed to functions that don't or shouldn't accept NULL. Also make it clear in the relevant comments that NULL is an expected case. This reverts commits a73c9dbab0165b3395dfe8a44a7dfd16166963c4 and 2e9650cbcff8c8fb0d9ef807c73a44f241822eee, which fixed specific crash symptoms by hacking things at what now seems to be the wrong end, ie the callee functions. Making the callees allow NULL is superficially more robust, but it's not always true that there is a defensible thing for the callee to do in such cases. The caller has more context and is better able to decide what the empty-query case ought to do. Per followup discussion of bug #11335. Back-patch to 9.2. The code before that is sufficiently different that it would require development of a separate patch, which doesn't seem worthwhile for what is believed to be an essentially cosmetic change. http://git.postgresql.org/pg/commitdiff/677708032c4a4d37cdb2a4bd45726fc260308db7
  • Fix pg_dumpall to restore its ability to dump from ancient servers. Fix breakage induced by commits d8d3d2a4f37f6df5d0118b7f5211978cca22091a and 463f2625a5fb183b6a8925ccde98bb3889f921d9: pg_dumpall has crashed when attempting to dump from pre-8.1 servers since then, due to faulty construction of the query used for dumping roles from older servers. The query was erroneous as of the earlier commit, but it wasn't exposed unless you tried to use --binary-upgrade, which you presumably wouldn't with a pre-8.1 server. However commit 463f2625a made it fail always. In HEAD, also fix additional breakage induced in the same query by commit 491c029dbc4206779cf659aa0ff986af7831d2ff, which evidently wasn't tested against pre-8.1 servers either. The bug is only latent in 9.1 because 463f2625a hadn't landed yet, but it seems best to back-patch all branches containing the faulty query. Gilles Darold http://git.postgresql.org/pg/commitdiff/be09ceb21882507bff95d74bad0ebe25efc227bd
  • Document evaluation-order considerations for aggregate functions. The SELECT reference page didn't really address the question of when aggregate function evaluation occurs, nor did the "expression evaluation rules" documentation mention that CASE can't be used to control whether an aggregate gets evaluated or not. Improve that. Per discussion of bug #11661. Original text by Marti Raudsepp and Michael Paquier, rewritten significantly by me. http://git.postgresql.org/pg/commitdiff/0ce627d465f534a3234750a5b398664dfece4102

Heikki Linnakangas a poussé :

Fujii Masao a poussé :

  • Add GUC and storage parameter to set the maximum size of GIN pending list. Previously the maximum size of GIN pending list was controlled only by work_mem. But the reasonable value of work_mem and the reasonable size of the list are basically not the same, so it was not appropriate to control both of them by only one GUC, i.e., work_mem. This commit separates new GUC, pending_list_cleanup_size, from work_mem to allow users to control only the size of the list. Also this commit adds pending_list_cleanup_size as new storage parameter to allow users to specify the size of the list per index. This is useful, for example, when users want to increase the size of the list only for the GIN index which can be updated heavily, and decrease it otherwise. Reviewed by Etsuro Fujita. http://git.postgresql.org/pg/commitdiff/a1b395b6a26ae80cde17fdfd2def8d351872f399
  • Add generate_series(numeric, numeric). Платон Малюгин. Reviewed by Michael Paquier, Ali Akbar and Marti Raudsepp http://git.postgresql.org/pg/commitdiff/1871c892021055532344266d7429b63f76a892c2
  • Rename pending_list_cleanup_size to gin_pending_list_limit. Since this parameter is only for GIN index, it's better to add "gin" to the parameter name for easier understanding. http://git.postgresql.org/pg/commitdiff/c291503b1c8250c7ba6ca900b7ba2f85a64b1eb6

Peter Eisentraut a poussé :

Noah Misch a poussé :

Andres Freund a poussé :

  • Add interrupt checks to contrib/pg_prewarm. Currently the extension's pg_prewarm() function didn't check interrupts once it started "warming" data. Since individual calls can take a long while it's important for them to be interruptible. Backpatch to 9.4 where pg_prewarm was introduced. http://git.postgresql.org/pg/commitdiff/bd4ae0f396b36955c92f26c0058e7dc0452db817
  • Fix several weaknesses in slot and logical replication on-disk serialization. Heikki noticed in 544E23C0.8090605@vmware.com that slot.c and snapbuild.c were missing the FIN_CRC32 call when computing/checking checksums of on disk files. That doesn't lower the the error detection capabilities of the checksum, but is inconsistent with other usages. In a followup mail Heikki also noticed that, contrary to a comment, the 'version' and 'length' struct fields of replication slot's on disk data where not covered by the checksum. That's not likely to lead to actually missed corruption as those fields are cross checked with the expected version and the actual file length. But it's wrong nonetheless. As fixing these issues makes existing on disk files unreadable, bump the expected versions of on disk files for both slots and logical decoding historic catalog snapshots. This means that loading old files will fail with ERROR: "replication slot file ... has unsupported version 1" and ERROR: "snapbuild state file ... has unsupported version 1 instead of 2" respectively. Given the low likelihood of anybody already using these new features in a production setup that seems acceptable. Fixing these issues made me notice that there's no regression test covering the loading of historic snapshot from disk - so add one. Backpatch to 9.4 where these features were introduced. http://git.postgresql.org/pg/commitdiff/ec5896aed3c01da24c1f335f138817e9890d68b6
  • Fix xmin/xmax horizon computation during logical decoding initialization. When building the initial historic catalog snapshot there were scenarios where snapbuild.c would use incorrect xmin/xmax values when starting from a xl_running_xacts record. The values used were always a bit suspect, but happened to be correct in the easy to test cases. Notably the values used when the the initial snapshot was computed while no other transactions were running were correct. This is likely to be the cause of the occasional buildfarm failures on animals markhor and tick; but it's quite possible to reproduce problems without CLOBBER_CACHE_ALWAYS. Backpatch to 9.4, where logical decoding was introduced. http://git.postgresql.org/pg/commitdiff/5a2c184058c51a41b855b9e824102d1395402ffa
  • Fix and improve cache invalidation logic for logical decoding. There are basically three situations in which logical decoding needs to perform cache invalidation. During/After replaying a transaction with catalog changes, when skipping a uninteresting transaction that performed catalog changes and when erroring out while replaying a transaction. Unfortunately these three cases were all done slightly differently - partially because 8de3e410fa, which greatly simplifies matters, got committed in the midst of the development of logical decoding. The actually problematic case was when logical decoding skipped transaction commits (and thus processed invalidations). When used via the SQL interface cache invalidation could access the catalog - bad, because we didn't set up enough state to allow that correctly. It'd not be hard to setup sufficient state, but the simpler solution is to always perform cache invalidation outside a valid transaction. Also make the different cache invalidation cases look as similar as possible, to ease code review. This fixes the assertion failure reported by Antonin Houska in 53EE02D9.7040702@gmail.com. The presented testcase has been expanded into a regression test. Backpatch to 9.4, where logical decoding was introduced. http://git.postgresql.org/pg/commitdiff/89fd41b390a46202937f647043043d5b0a4eadae
  • Adapt valgrind.supp to the XLogInsert() split. The CRC computation now happens in XLogInsertRecord(), not XLogInsert() itself anymore. http://git.postgresql.org/pg/commitdiff/473f162ce1faabeb2d572b9805311081919e5deb
  • Move BufferGetBlockNumber() out of heap_page_is_all_visible()'s inner loop. In some workloads BufferGetBlockNumber() shows up in profiles due to the sheer number of calls to it (and because it causes cache misses). The compiler can't move it out of the loop because it's a full extern function call... http://git.postgresql.org/pg/commitdiff/0c5af0a537a2d6320eb8ef7f401401aa1f47b79e
  • Add valgrind suppression for pg_atomic_init_u64. pg_atomic_init_u64 (indirectly) uses compare/exchange to guarantee atomic writes on platforms where compare/exchange is available, but 64bit writes aren't atomic (yes, those exist). That leads to a harmless read of the initial value of variable. http://git.postgresql.org/pg/commitdiff/6c878edc1df9d4d9ad7ed4a7e1c34c0bf0f622b9
  • Fix initdb --sync-only to also sync tablespaces. 630cd14426dc added initdb --sync-only, for use by pg_upgrade, by just exposing the existing fsync code. That's wrong, because initdb so far had absolutely no reason to deal with tablespaces. Fix --sync-only by additionally explicitly syncing each of the tablespaces. Backpatch to 9.3 where --sync-only was introduced. Abhijit Menon-Sen and Andres Freund http://git.postgresql.org/pg/commitdiff/522c85a6a27b614589543eddb68a4c8f7fcac901
  • Ensure unlogged tables are reset even if crash recovery errors out. Unlogged relations are reset at the end of crash recovery as they're only synced to disk during a proper shutdown. Unfortunately that and later steps can fail, e.g. due to running out of space. This reset was, up to now performed after marking the database as having finished crash recovery successfully. As out of space errors trigger a crash restart that could lead to the situation that not all unlogged relations are reset. Once that happend usage of unlogged relations could yield errors like "could not open file "...": No such file or directory". Luckily clusters that show the problem can be fixed by performing a immediate shutdown, and starting the database again. To fix, just call ResetUnloggedRelations(UNLOGGED_RELATION_INIT) earlier, before marking the database as having successfully recovered. Discussion: 20140912112246.GA4984@alap3.anarazel.de Backpatch to 9.1 where unlogged tables were introduced. Abhijit Menon-Sen and Andres Freund http://git.postgresql.org/pg/commitdiff/d3586fc8aa5d9365a5c50cb5e555971eb633a4ec
  • Sync unlogged relations to disk after they have been reset. Unlogged relations are only reset when performing a unclean restart. That means they have to be synced to disk during clean shutdowns. During normal processing that's achieved by registering a buffer's file to be fsynced at the next checkpoint when flushed. But ResetUnloggedRelations() doesn't go through the buffer manager, so nothing will force reset relations to disk before the next shutdown checkpoint. So just make ResetUnloggedRelations() fsync the newly created main forks to disk. Discussion: 20140912112246.GA4984@alap3.anarazel.de Backpatch to 9.1 where unlogged tables were introduced. Abhijit Menon-Sen and Andres Freund http://git.postgresql.org/pg/commitdiff/98ec7fd903bbd4ab1694de5aaa4f7bb62935c58d

Stephen Frost a poussé :

  • Revert change to ALTER TABLESPACE summary. When ALTER TABLESPACE MOVE ALL was changed to be ALTER TABLE ALL IN TABLESPACE, the ALTER TABLESPACE summary should have been adjusted back to its original definition. Patch by Thom Brown (thanks!). http://git.postgresql.org/pg/commitdiff/155c0f24b7d370eb57fb8dde0447e11e41c405c2
  • Clean up includes from RLS patch The initial patch for RLS mistakenly included headers associated with the executor and planner bits in rewrite/rowsecurity.h. Per policy and general good sense, executor headers should not be included in planner headers or vice versa. The include of execnodes.h was a mistaken holdover from previous versions, while the include of relation.h was used for Relation's definition, which should have been coming from utils/relcache.h. This patch cleans these issues up, adds comments to the RowSecurityPolicy struct and the RowSecurityConfigType enum, and changes Relation->rsdesc to Relation->rd_rsdesc to follow Relation field naming convention. Additionally, utils/rel.h was including rewrite/rowsecurity.h, which wasn't a great idea since that was pulling in things not really needed in utils/rel.h (which gets included in quite a few places). Instead, use 'struct RowSecurityDesc' for the rd_rsdesc field and add comments explaining why. Lastly, add an include into access/nbtree/nbtsort.c for utils/sortsupport.h, which was evidently missed due to the above mess. Pointed out by Tom in 16970.1415838651@sss.pgh.pa.us; note that the concerns regarding a similar situation in the custom-path commit still need to be addressed. http://git.postgresql.org/pg/commitdiff/80eacaa3cdcd10383c333f6f4625af8cee1f7bee

Simon Riggs a poussé :

Magnus Hagander a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Peter Geoghegan sent in a pair of patches, one to add abbreviated sortsupport keys, the other to estimate total number of rows to be sorted.
  • Tomas Vondra sent in another revision of a patch to implement multi-column statistics.
  • Peter Geoghegan sent in another revision of a patch to implement INSERT ... ON CONFLICT.
  • Magnus Hagander sent in another revision of a patch to implement an SSL information view.
  • Kaigai Kouhei sent in a patch to add a missing Assert() to the custom plan API.
  • Michael Paquier sent in another revision of a patch to compress full-page writes.
  • Kyotaro HORIGUCHI sent in two more revisions of a patch to implement ALTER RULE ... CURRENT_USER.
  • Simon Riggs sent in a patch to add an option to pg_dump which would have it dump constraints as NOT VALID.
  • Michael Paquier sent in another revision of a patch to implement REINDEX CONCURRENTLY.
  • Heikki Linnakangas sent in three more revisions of a patch to change the WAL format and API.
  • Fabrízio de Royes Mello and Michael Paquier traded patches to implement ALTER TABLE ... SET LOGGED.
  • Etsuro Fujita sent in a patch to fix some odd behavior in the postgres_fdw.
  • Robert Haas sent a patch to add infrastructure to save and restore GUC values, and one which depends on it to run commands in a background worker and get the results.
  • Fujii Masao sent in another revision of a patch to add fsync feedback to pg_receivexlog --status-interval.
  • Andreas Karlsson sent in two more revisions of a patch to use 128-bit integers for sum, avg and statistics aggregates.
  • Petr (PJMODOS) Jelinek sent in another revision of a patch to track commit timestamps.
  • Etsuro Fujita sent in two revisions of a patch to fix some typos in the CREATE TABLE documentation.
  • Alexander Shulgin sent in a PoC patch to allow timing out transactions in the "Idle In Transaction" state.
  • Andrew Dunstan sent in a patch to control psql's interaction with the pager at a finer grain.
  • David Rowley sent in another revision of a patch to remove inner joins under certain conditions.
  • Michael Paquier sent in two revisions of a patch to fix an issue where PostgreSQL doesn't stop properly when --slot option is specified with pg_receivexlog.
  • Pavel Stehule sent in another revision of a patch to add asciidoc as an output option for psql.
  • Michael Paquier sent in another revision of a patch to refactor the code for sync node detection.

par N Bougain le mardi 18 novembre 2014 à 22h24

mercredi 12 novembre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 9 novembre 2014

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en novembre

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

Tom Lane a poussé :

  • Docs: fix incorrect spelling of contrib/pgcrypto option. pgp_sym_encrypt's option is spelled "sess-key", not "enable-session-key". Spotted by Jeff Janes. In passing, improve a comment in pgp-pgsql.c to make it clearer that the debugging options are intentionally undocumented. http://git.postgresql.org/pg/commitdiff/f443de873e500de999a2d165731a0356b79a6ed7
  • Drop no-longer-needed buffers during ALTER DATABASE SET TABLESPACE. The previous coding assumed that we could just let buffers for the database's old tablespace age out of the buffer arena naturally. The folly of that is exposed by bug #11867 from Marc Munro: the user could later move the database back to its original tablespace, after which any still-surviving buffers would match lookups again and appear to contain valid data. But they'd be missing any changes applied while the database was in the new tablespace. This has been broken since ALTER SET TABLESPACE was introduced, so back-patch to all supported branches. http://git.postgresql.org/pg/commitdiff/33f80f8480434f02beb940b8f0627d534f3fd3af
  • Fix volatility markings of some contrib I/O functions. In general, datatype I/O functions are supposed to be immutable or at worst stable. Some contrib I/O functions were, through oversight, not marked with any volatility property at all, which made them VOLATILE. Since (most of) these functions actually behave immutably, the erroneous marking isn't terribly harmful; but it can be user-visible in certain circumstances, as per a recent bug report from Joe Van Dyk in which a cast to text was disallowed in an expression index definition. To fix, just adjust the declarations in the extension SQL scripts. If we were being very fussy about this, we'd bump the extension version numbers, but that seems like more trouble (for both developers and users) than the problem is worth. A fly in the ointment is that chkpass_in actually is volatile, because of its use of random() to generate a fresh salt when presented with a not-yet-encrypted password. This is bad because of the general assumption that I/O functions aren't volatile: the consequence is that records or arrays containing chkpass elements may have input behavior a bit different from a bare chkpass column. But there seems no way to fix this without breaking existing usage patterns for chkpass, and the consequences of the inconsistency don't seem bad enough to justify that. So for the moment, just document it in a comment. Since we're not bumping version numbers, there seems no harm in back-patching these fixes; at least future installations will get the functions marked correctly. http://git.postgresql.org/pg/commitdiff/66c029c842629958b3ae0d389f24ea3407225723
  • Make CREATE TYPE print warnings if a datatype's I/O functions are volatile. This is a followup to commit 43ac12c6e6e397fd9142ed908447eba32d3785b2, which added regression tests checking that I/O functions of built-in types are not marked volatile. Complaining in CREATE TYPE should push developers of add-on types to fix any misdeclared functions in their types. It's just a warning not an error, to avoid creating upgrade problems for what might be just cosmetic mis-markings. Aside from adding the warning code, fix a number of types that were sloppily created in the regression tests. http://git.postgresql.org/pg/commitdiff/465d7e1882bc1f316c7cb2a68e751c34b403e8d7
  • Remove the last vestige of server-side autocommit. Long ago we briefly had an "autocommit" GUC that turned server-side autocommit on and off. That behavior was removed in 7.4 after concluding that it broke far too much client-side logic, and making clients cope with both behaviors was impractical. But the GUC variable was left behind, so as not to break any client code that might be trying to read its value. Enough time has now passed that we should remove the GUC completely. Whatever vestigial backwards-compatibility benefit it had is outweighed by the risk of confusion for newbies who assume it ought to do something, as per a recent complaint from Wolfgang Wilhelm. In passing, adjust what seemed to me a rather confusing documentation reference to libpq's autocommit behavior. libpq as such knows nothing about autocommit, so psql is probably what was meant. http://git.postgresql.org/pg/commitdiff/525a489915cad1c5b2fc39e43e8005025afe63b2
  • Fix normalization of numeric values in JSONB GIN indexes. The default JSONB GIN opclass (jsonb_ops) converts numeric data values to strings for storage in the index. It must ensure that numeric values that would compare equal (such as 12 and 12.00) produce identical strings, else index searches would have behavior different from regular JSONB comparisons. Unfortunately the function charged with doing this was completely wrong: it could reduce distinct numeric values to the same string, or reduce equivalent numeric values to different strings. The former type of error would only lead to search inefficiency, but the latter type of error would cause index entries that should be found by a search to not be found. Repairing this bug therefore means that it will be necessary for 9.4 beta testers to reindex GIN jsonb_ops indexes, if they care about getting correct results from index searches involving numeric data values within the comparison JSONB object. Per report from Thomas Fanghaenel. http://git.postgresql.org/pg/commitdiff/4875931938b27924fe8d6f91bbdb09e2e5a29d0a
  • Cope with more than 64K phrases in a thesaurus dictionary. dict_thesaurus stored phrase IDs in uint16 fields, so it would get confused and even crash if there were more than 64K entries in the configuration file. It turns out to be basically free to widen the phrase IDs to uint32, so let's just do so. This was complained of some time ago by David Boutin (in bug #7793); he later submitted an informal patch but it was never acted on. We now have another complaint (bug #11901 from Luc Ouellette) so it's time to make something happen. This is basically Boutin's patch, but for future-proofing I also added a defense against too many words per phrase. Note that we don't need any explicit defense against overflow of the uint32 counters, since before that happens we'd hit array allocation sizes that repalloc rejects. Back-patch to all supported branches because of the crash risk. http://git.postgresql.org/pg/commitdiff/d6e37b35cda9a88dfd938dd61e9986dd93cc6dd3

Robert Haas a poussé :

Heikki Linnakangas a poussé :

  • Switch to CRC-32C in WAL and other places. The old algorithm was found to not be the usual CRC-32 algorithm, used by Ethernet et al. We were using a non-reflected lookup table with code meant for a reflected lookup table. That's a strange combination that AFAICS does not correspond to any bit-wise CRC calculation, which makes it difficult to reason about its properties. Although it has worked well in practice, seems safer to use a well-known algorithm. Since we're changing the algorithm anyway, we might as well choose a different polynomial. The Castagnoli polynomial has better error-correcting properties than the traditional CRC-32 polynomial, even if we had implemented it correctly. Another reason for picking that is that some new CPUs have hardware support for calculating CRC-32C, but not CRC-32, let alone our strange variant of it. This patch doesn't add any support for such hardware, but a future patch could now do that. The old algorithm is kept around for tsquery and pg_trgm, which use the values in indexes that need to remain compatible so that pg_upgrade works. While we're at it, share the old lookup table for CRC-32 calculation between hstore, ltree and core. They all use the same table, so might as well. http://git.postgresql.org/pg/commitdiff/5028f22f6eb0579890689655285a4778b4ffc460
  • Remove support for 64-bit CRC. It hasn't been used for anything for a long time. http://git.postgresql.org/pg/commitdiff/404bc51cde9dce1c674abe4695635612f08fe27e
  • Remove obsolete cases from GiST update redo code. The code that generated a record to clear the F_TUPLES_DELETED flag hasn't existed since we got rid of old-style VACUUM FULL. I kept the code that sets the flag, although it's not used for anything anymore, because it might still be interesting information for debugging purposes that some tuples have been deleted from a page. Likewise, the code to turn the root page from non-leaf to leaf page was removed when we got rid of old-style VACUUM FULL. Remove the code to replay that action, too. http://git.postgresql.org/pg/commitdiff/2effb72e682a7dbdc9a8a60a80c22ec1fa9d8079
  • Fix generation of SP-GiST vacuum WAL records. I broke these in 8776faa81cb651322b8993422bdd4633f1f6a487. Backpatch to 9.4, where that was done. http://git.postgresql.org/pg/commitdiff/1961b1c131e4211f3dc86ff2be971e430ab2a23d
  • Fix building with WAL_DEBUG. Now that the backup blocks are appended to the WAL record in xloginsert.c, XLogInsert doesn't see them anymore and cannot remove them from the version reconstructed for xlog_outdesc. This makes running with wal_debug=on more expensive, as we now make (unnecessary) temporary copies of the backup blocks, but it doesn't seem worth convoluting the code to keep that optimization. Reported by Alvaro Herrera. http://git.postgresql.org/pg/commitdiff/7250d8535b11d6443a9b27299e586c3df0654302
  • Move the backup-block logic from XLogInsert to a new file, xloginsert.c. xlog.c is huge, this makes it a little bit smaller, which is nice. Functions related to putting together the WAL record are in xloginsert.c, and the lower level stuff for managing WAL buffers and such are in xlog.c. Also move the definition of XLogRecord to a separate header file. This causes churn in the #includes of all the files that write WAL records, and redo routines, but it avoids pulling in xlog.h into most places. Reviewed by Michael Paquier, Alvaro Herrera, Andres Freund and Amit Kapila. http://git.postgresql.org/pg/commitdiff/2076db2aea766c4c828dccc34ae35f614129000d

Peter Eisentraut a poussé :

Bruce Momjian a poussé :

Fujii Masao a poussé :

Álvaro Herrera a poussé :

  • Fix serial schedule. Test misc depends on brin, but it was earlier in the serial schedule file. I didn't notice this because I only run the parallel schedule, but the buildfarm exposed my folly ... http://git.postgresql.org/pg/commitdiff/0e892e04efdc92abf53260e0bb0092cc48060e22
  • BRIN: Block Range Indexes. BRIN is a new index access method intended to accelerate scans of very large tables, without the maintenance overhead of btrees or other traditional indexes. They work by maintaining "summary" data about block ranges. Bitmap index scans work by reading each summary tuple and comparing them with the query quals; all pages in the range are returned in a lossy TID bitmap if the quals are consistent with the values in the summary tuple, otherwise not. Normal index scans are not supported because these indexes do not store TIDs. As new tuples are added into the index, the summary information is updated (if the block range in which the tuple is added is already summarized) or not; in the latter case, a subsequent pass of VACUUM or the brin_summarize_new_values() function will create the summary information. For data types with natural 1-D sort orders, the summary info consists of the maximum and the minimum values of each indexed column within each page range. This type of operator class we call "Minmax", and we supply a bunch of them for most data types with B-tree opclasses. Since the BRIN code is generalized, other approaches are possible for things such as arrays, geometric types, ranges, etc; even for things such as enum types we could do something different than minmax with better results. In this commit I only include minmax. Catalog version bumped due to new builtin catalog entries. There's more that could be done here, but this is a good step forwards. Loosely based on ideas from Simon Riggs; code mostly by Álvaro Herrera, with contribution by Heikki Linnakangas. Patch reviewed by: Amit Kapila, Heikki Linnakangas, Robert Haas. Testing help from Jeff Janes, Erik Rijkers, Emanuel Calvo. p.s.: The research leading to these results has received funding from the European Union's Seventh Framework Programme (FP7/2007-2013) under grant agreement n° 318633. http://git.postgresql.org/pg/commitdiff/7516f5259411c02ae89e49084452dc342aadb2ae
  • Fix some coding issues in BRIN. Reported by David Rowley: variadic macros are a problem. Get rid of them using a trick suggested by Tom Lane: add extra parentheses where needed. In the future we might decide we don't need the calls at all and remove them, but it seems appropriate to keep them while this code is still new. Also from David Rowley: brininsert() was trying to use a variable before initializing it. Fix by moving the brin_form_tuple call (which initializes the variable) to within the locked section. Reported by Peter Eisentraut: can't use "new" as a struct member name, because C++ compilers will choke on it, as reported by cpluspluscheck. http://git.postgresql.org/pg/commitdiff/b89ee54e20e722bb91f388667586a2e0986f197b

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Abhijit Menon-Sen sent in another revision of a patch to implement pg_audit.
  • Alexey Vasiliev sent in two revisions of a patch to add a recovery_timeout option to control the timeout of restore_command nonzero status code.
  • Rahila Syed sent in two more revisions of a patch to allow compressing full-page writes.
  • Andrew Dunstan sent in a patch to add a utility function to look up the cast function for a from/to pair of types.
  • Heikki Linnakangas sent in another revision of a patch to change the WAL format and APIs.
  • Ali Akbar sent in another revision of a patch to fix xpath() to return namespace definitions.
  • Peter Geoghegan sent in another revision of a patch to implement INSERT ... ON CONFLICT ...
  • Adam Brightwell sent in another revision of a patch to replace some of the superuser() shortcuts with more specific role checks.
  • Michael Paquier sent in another revision of a patch to implement REINDEX CONCURRENTLY.
  • Robert Haas sent in a PoC patch to implement group locking.
  • Abhijit Menon-Sen sent in another revision of a patch to fsync PGDATA recursively in the case of crash recovery.
  • Fujii Masao sent in another revision of a patch to add a GIN GUC pending_list_cleanup_size.
  • Jim Nasby sent in a patch to retry failed attempts to obtain the cleanup lock on a buffer during VACUUM.
  • Etsuro Fujita sent in another revision of a patch to allow foreign tables to be part of table inheritance hierarchies.
  • Dimitri Fontaine sent in another revision of a patch to add event triggers for table rewrites.
  • Fujii Masao sent in another revision of a patch to add fsync feedback to pg_receivexlog --status-interval.
  • Michael Paquier sent in a patch to add a dedicated macro to grab a relation's persistence.
  • Ad sent in another revision of a patch to add jsonb generator functions.
  • Michael Paquier sent in another revision of a patch to move all quote-related functions into a single header quote.h.
  • Michael Banck sent in a patch to add a log_min_duration_transaction GUC.
  • Tom Lane sent in two revisions of a patch to fix an infelicity between index-only scans and row_to_json.
  • Magnus Hagander sent in a patch to re-order the views in the stats docs for clarity.

par N Bougain le mercredi 12 novembre 2014 à 13h58

mardi 4 novembre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 2 novembre 2014

PG-Cuba aura lieu les 25 & 26 novembre : http://postgresql.uci.cu/?p=1087#more-1087

L'appel à conférenciers pour le PGDay (30 janvier 2015) et la dev room PostgreSQL du FOSDEM (31 janvier au 1er février 2015) est lancé. Date limite des candidatures : 24 novembre 2014 : http://fosdem2015.pgconf.eu/callforpapers/

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en novembre

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

Bruce Momjian a poussé :

Heikki Linnakangas a poussé :

Robert Haas a poussé :

  • Add missing equals signs to pg_recvlogical documentation. Michael Paquier http://git.postgresql.org/pg/commitdiff/7f609a10adb5419c68fc683594fcd14f1e7322fb
  • Avoid setup work for invalidation messages at start-of-(sub)xact. Instead of initializing a new TransInvalidationInfo for every transaction or subtransaction, we can just do it for those transactions or subtransactions that actually need to queue invalidation messages. That also avoids needing to free those entries at the end of a transaction or subtransaction that does not generate any invalidation messages, which is by far the common case. Patch by me. Review by Simon Riggs and Andres Freund. http://git.postgresql.org/pg/commitdiff/6cb4afff33ba0b6f88cca2967904ad501d648e2f
  • "Pin", rather than "keep", dynamic shared memory mappings and segments. Nobody seemed concerned about this naming when it originally went in, but there's a pending patch that implements the opposite of dsm_keep_mapping, and the term "unkeep" was judged unpalatable. "unpin" has existing precedent in the PostgreSQL code base, and the English language, so use this terminology instead. Per discussion, back-patch to 9.4. http://git.postgresql.org/pg/commitdiff/6057c212f3e783c45e050a78d070edf3e5f069f0
  • Extend dsm API with a new function dsm_unpin_mapping. This reassociates a dynamic shared memory handle previous passed to dsm_pin_mapping with the current resource owner, so that it will be cleaned up at the end of the current query. Patch by me. Review of the function name by Andres Freund, Amit Kapila, Jim Nasby, Petr Jelinek, and Álvaro Herrera. http://git.postgresql.org/pg/commitdiff/f7102b04638a882b38cbba7670471a073a939865
  • Support frontend-backend protocol communication using a shm_mq. A background worker can use pq_redirect_to_shm_mq() to direct protocol that would normally be sent to the frontend to a shm_mq so that another process may read them. The receiving process may use pq_parse_errornotice() to parse an ErrorResponse or NoticeResponse from the background worker and, if it wishes, ThrowErrorData() to propagate the error (with or without further modification). Patch by me. Review by Andres Freund. http://git.postgresql.org/pg/commitdiff/2bd9e412f92bc6a68f3e8bcb18e04955cc35001d

Noah Misch a poussé :

  • MinGW: Include .dll extension in .def file LIBRARY commands. Newer toolchains append the extension implicitly if missing, but buildfarm member narwhal (gcc 3.4.2, ld 2.15.91 20040904) does not. This affects most core libraries having an exports.txt file, namely libpq and the ECPG support libraries. On Windows Server 2003, Windows API functions that load and unload DLLs internally will mistakenly unload a libpq whose DLL header reports "LIBPQ" instead of "LIBPQ.dll". When, subsequently, control would return to libpq, the backend crashes. Back-patch to 9.4, like commit 846e91e0223cf9f2821c3ad4dfffffbb929cb027. Before that commit, we used a different linking technique that yielded "libpq.dll" in the DLL header. Commit 53566fc0940cf557416b13252df57350a4511ce4 worked around this by eliminating a call to a function that loads and unloads DLLs internally. That commit is no longer necessary for correctness, but its improving consistency with the MSVC build remains valid. http://git.postgresql.org/pg/commitdiff/c0e190365b93bbf717540d8e7653c65a9f6c5650
  • Fix win32setlocale.c const-related warnings. Back-patch to 9.2, like commit db29620d4d16e08241f965ccd70d0f65883ff0de. http://git.postgresql.org/pg/commitdiff/846319521753af63c8f9b0893a116adc0a70e936
  • Re-remove dependency on the DLL of pythonxx.def file. The reasons behind commit 0d147e43adcf5d2bff9caa073608f381a27439bf still stand, so this reverts the non-cosmetic portion of commit a7983e989d9cafc9cef49becfee054e34b1ed9b4. Back-patch to 9.4, where the latter commit first appeared. http://git.postgresql.org/pg/commitdiff/00c07e497f31e44ddf971e2d5f14240971ed5175
  • Make ECPG test programs depend on "ecpg$(X)", not "ecpg". Cygwin builds require this of dependencies pertaining to pattern rules. On Cygwin, stat("foo") in the absence of a file with that exact name can locate foo.exe. While GNU make uses stat() for dependencies of ordinary rules, it uses readdir() to assess dependencies of pattern rules. Therefore, a pattern rule dependency should match any underlying file name exactly. Back-patch to 9.4, where the dependency was introduced. http://git.postgresql.org/pg/commitdiff/67a412049489f554c3a552bd523cefd30d038221
  • Remove dead-since-introduction pgcrypto code. Marko Tiikkaja http://git.postgresql.org/pg/commitdiff/1ed8e771ade6f2a58728f4537e9c19b702d8cf25
  • Clarify .def file comments. http://git.postgresql.org/pg/commitdiff/c40212baf6c093b4958c6e04ddde94869788a572

Tom Lane a poussé :

  • Remove obsolete commentary. Since we got rid of non-MVCC catalog scans, the fourth reason given for using a non-transactional update in index_update_stats() is obsolete. The other three are still good, so we're not going to change the code, but fix the comment. http://git.postgresql.org/pg/commitdiff/a00d468e658a245823083b9ac2e423a659a03802
  • Avoid corrupting tables when ANALYZE inside a transaction is rolled back. VACUUM and ANALYZE update the target table's pg_class row in-place, that is nontransactionally. This is OK, more or less, for the statistical columns, which are mostly nontransactional anyhow. It's not so OK for the DDL hint flags (relhasindex etc), which might get changed in response to transactional changes that could still be rolled back. This isn't a problem for VACUUM, since it can't be run inside a transaction block nor in parallel with DDL on the table. However, we allow ANALYZE inside a transaction block, so if the transaction had earlier removed the last index, rule, or trigger from the table, and then we roll back the transaction after ANALYZE, the table would be left in a corrupted state with the hint flags not set though they should be. To fix, suppress the hint-flag updates if we are InTransactionBlock(). This is safe enough because it's always OK to postpone hint maintenance some more; the worst-case consequence is a few extra searches of pg_index et al. There was discussion of instead using a transactional update, but that would change the behavior in ways that are not all desirable: in most scenarios we're better off keeping ANALYZE's statistical values even if the ANALYZE itself rolls back. In any case we probably don't want to change this behavior in back branches. Per bug #11638 from Casey Shobe. This has been broken for a good long time, so back-patch to all supported branches. Tom Lane and Michael Paquier, initial diagnosis by Andres Freund http://git.postgresql.org/pg/commitdiff/e0722d9cb57d06c2e459cf338cf7387ec3edb1f5
  • Test IsInTransactionChain, not IsTransactionBlock, in vac_update_relstats. As noted by Noah Misch, my initial cut at fixing bug #11638 didn't cover all cases where ANALYZE might be invoked in an unsafe context. We need to test the result of IsInTransactionChain not IsTransactionBlock; which is notationally a pain because IsInTransactionChain requires an isTopLevel flag, which would have to be passed down through several levels of callers. I chose to pass in_outer_xact (ie, the result of IsInTransactionChain) rather than isTopLevel per se, as that seemed marginally more apropos for the intermediate functions to know about. http://git.postgresql.org/pg/commitdiff/fd0f651a867ce4a25160e37bcb9085f3b3209bf8

Peter Eisentraut a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Kaigai Kouhei sent in another revision of a patch to implement a custom plan API.
  • Pavel Stehule sent in another revision of a patch to add "strip nulls" functions to JSON[B].
  • Abhijit Menon-Sen sent in another revision of a patch to call ResetUnloggedRelations(UNLOGGED_RELATION_INIT) earlier.
  • Stephen Frost sent in a patch to fix some lacunae in the use of GetUserId().
  • Heikki Linnakangas sent patches to rationalize use of CRC algorithms, removing the unused 64-bit version and redoing the ones that won't break pg_upgrade to algorithms with well-known properties.
  • Ali Akbar and Pavel Stehule traded patches to implement array_agg(ANYARRAY).
  • Michael Paquier sent in another revision of a patch to add a --snapshot option to pg_dump.
  • Andrew Dunstan sent in another revision of a patch to add some missing JSON[B] functions.
  • Stephen Frost sent in another revision of a patch to clean up superuser().
  • Amit Kapila sent in another revision of a patch to allow parallel cores to be used by vacuumdb.
  • Adam Brightwell sent in another revision of a patch to add directory and file access permissions for COPY and generic file access functions.
  • Andres Freund sent in a WIP patch to implement a lockless StrategyGetBuffer() clock sweep.
  • Marko (johto) Tiikkaja sent in two more revisions of a patch to add PGP signatures to the pgcrypto contrib extension.
  • Rahila Syed sent in another revision of a patch to do compression of full-page writes.
  • Michael Paquier sent in another revision of a patch to implement REINDEX CONCURRENTLY.
  • Andres Freund sent in a patch to eliminate "snapshot too large" messages by doubling the array size until the snapshot is no longer too large for it.
  • Peter Eisentraut sent in a patch to see to it that TAP tests run in a deeply nested directory tree.
  • Peter Eisentraut sent in a patch to handle the situation where the "prove" utility is not available.
  • Etsuro Fujita sent in a patch to improve automatic analyze messages for inheritance trees.
  • Stephen Frost sent in a patch to fix an incompatibility between views created with WITH CHECK OPTION and column-level privileges.
  • Szymon Guz and Pavel Stehule traded patches to add asciidoc format to psql table output.
  • Heikki Linnakangas sent in another revision of a patch to change the API and format of WALs.
  • Kyotaro HORIGUCHI and Adam Brightwell traded patches to implement ALTER USER/ROLE...CURRENT USER.
  • Abhijit Menon-Sen sent in a patch to initdb to make initdb -S fsync everything under pg_tblspc.
  • Fujii Masao sent in another revision of a patch to add a pending_list_cleanup_size GUC and associated machinery.
  • Michael Paquier sent in two more revisions of a patch to factor the code for sync node detection out of walsender.c and syncrep.c.
  • Fabrízio de Royes Mello sent in another revision of a patch to implement CINE for indexes.
  • Jim Nasby sent in a patch to move the bulk of exec_simple_query into exec_query_string() so that pg_backend can also make use of it.
  • Robert Haas sent in another revision of a patch to implement pg_background, which runs commands in a background worker, and gets the results.
  • Peter Eisentraut sent in a patch to add a ./configure enable_tap_tests option.
  • Fabrízio de Royes Mello sent in another revision of a patch to implement CINE functionality for materialized views.
  • Furuya Osamu sent in another revision of a patch to add fsync feedback to pg_receivexlog --status-interval.
  • Petr (PJMODOS) Jelinek sent in another revision of a patch to add a shutdown_at_recovery_target option to recovery.conf.
  • Thomas Munro sent in another revision of a patch to support DISTINCT with a btree skip scan.
  • Andres Freund sent in a patch to fix an issue with large tables in two parts: a faster PageIsVerified() for the all zeroes case, and a much faster O-1 mfdvec, removing the quadratic behavior in same.
  • Simon Riggs sent in a patch to reduce logging of AccessExclusiveLocks for temp tables by skipping logging locks in the case of relation_open_temp().
  • Petr (PJMODOS) Jelinek sent in another revision of a patch to track commit timestamps.

par N Bougain le mardi 4 novembre 2014 à 22h00

vendredi 31 octobre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 26 octobre 2014

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en octobre

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

Robert Haas a poussé :

Tom Lane a poussé :

  • Fix file-identification comment in contrib/pgcrypto/pgcrypto--1.2.sql. Cosmetic oversight in commit 32984d8fc3dbb90a3fafb69fece0134f1ea790f9. Marko Tiikkaja http://git.postgresql.org/pg/commitdiff/488a7c9ccff54f947d5a51f00efe873f4bae909a
  • Fix mishandling of FieldSelect-on-whole-row-Var in nested lateral queries. If an inline-able SQL function taking a composite argument is used in a LATERAL subselect, and the composite argument is a lateral reference, the planner could fail with "variable not found in subplan target list", as seen in bug #11703 from Karl Bartel. (The outer function call used in the bug report and in the committed regression test is not really necessary to provoke the bug --- you can get it if you manually expand the outer function into "LATERAL (SELECT inner_function(outer_relation))", too.) The cause of this is that we generate the reltargetlist for the referenced relation before doing eval_const_expressions() on the lateral sub-select's expressions (cf find_lateral_references()), so what's scheduled to be emitted by the referenced relation is a whole-row Var, not the simplified single-column Var produced by optimizing the function's FieldSelect on the whole-row Var. Then setrefs.c fails to match up that lateral reference to what's available from the outer scan. Preserving the FieldSelect optimization in such cases would require either major planner restructuring (to recursively do expression simplification on sub-selects much earlier) or some amazingly ugly kluge to change the reltargetlist of a possibly-already-planned relation. It seems better just to skip the optimization when the Var is from an upper query level; the case is not so common that it's likely anyone will notice a few wasted cycles. AFAICT this problem only occurs for uplevel LATERAL references, so back-patch to 9.3 where LATERAL was added. http://git.postgresql.org/pg/commitdiff/f330a6d14066277e78586cb4ceb8692ca3533046
  • Update expected/sequence_1.out. The last three updates to the sequence regression test have all forgotten to touch the alternate expected-output file. Sigh. Michael Paquier http://git.postgresql.org/pg/commitdiff/31dd7fcd03609dbc3c3be85e645ccc7c715db719
  • Ensure libpq reports a suitable error message on unexpected socket EOF. The EOF-detection logic in pqReadData was a bit confused about who should set up the error message in case the kernel gives us read-ready-but-no-data rather than ECONNRESET or some other explicit error condition. Since the whole point of this situation is that the lower-level functions don't know there's anything wrong, pqReadData itself must set up the message. But keep the assumption that if an errno was reported, a message was set up at lower levels. Per bug #11712 from Marko Tiikkaja. It's been like this for a very long time, so back-patch to all supported branches. http://git.postgresql.org/pg/commitdiff/69fed5b26fa34fc825c7ed0a8d97221ff448e9c5
  • Improve ispell dictionary's defenses against bad affix files. Don't crash if an ispell dictionary definition contains flags but not any compound affixes. (This isn't a security issue since only superusers can install affix files, but still it's a bad thing.) Also, be more careful about detecting whether an affix-file FLAG command is old-format (ispell) or new-format (myspell/hunspell). And change the error message about mixed old-format and new-format commands into something intelligible. Per bug #11770 from Emre Hasegeli. Back-patch to all supported branches. http://git.postgresql.org/pg/commitdiff/b34d6f03dbb34027ee0ee6f1c1887ae30ec7b07d
  • In type_sanity, check I/O functions of built-in types are not volatile. We have a project policy that I/O functions must not be volatile, as per commit aab353a60b95aadc00f81da0c6d99bde696c4b75, but we weren't doing anything to enforce that. In most usage the marking of the function doesn't matter as long as its behavior is sane --- but I/O casts can expose the marking as user-visible behavior, as per today's complaint from Joe Van Dyk about contrib/ltree. This test as such will only protect us against future errors in built-in data types. To catch the same error in contrib or third-party types, perhaps we should make CREATE TYPE complain? But that's a separate issue from enforcing the policy for built-in types. http://git.postgresql.org/pg/commitdiff/43ac12c6e6e397fd9142ed908447eba32d3785b2
  • Improve planning of btree index scans using ScalarArrayOpExpr quals. Since we taught btree to handle ScalarArrayOpExpr quals natively (commit 9e8da0f75731aaa7605cf4656c21ea09e84d2eb1), the planner has always included ScalarArrayOpExpr quals in index conditions if possible. However, if the qual is for a non-first index column, this could result in an inferior plan because we can no longer take advantage of index ordering (cf. commit 807a40c551dd30c8dd5a0b3bd82f5bbb1e7fd285). It can be better to omit the ScalarArrayOpExpr qual from the index condition and let it be done as a filter, so that the output doesn't need to get sorted. Indeed, this is true for the query introduced as a test case by the latter commit. To fix, restructure get_index_paths and build_index_paths so that we consider paths both with and without ScalarArrayOpExpr quals in non-first index columns. Redesign the API of build_index_paths so that it reports what it found, saving useless second or third calls. Report and patch by Andrew Gierth (though rather heavily modified by me). Back-patch to 9.2 where this code was introduced, since the issue can result in significant performance regressions compared to plans produced by 9.1 and earlier. http://git.postgresql.org/pg/commitdiff/a4523c5aa5349510ddb74abddc416add2536ec3d
  • Fix undersized result buffer in pset_quoted_string(). The malloc request was 1 byte too small for the worst-case output. This seems relatively unlikely to cause any problems in practice, as the worst case only occurs if the input string contains no characters other than single-quote or newline, and even then malloc alignment padding would probably save the day. But it's definitely a bug. David Rowley http://git.postgresql.org/pg/commitdiff/9711fa06081da230e62fa52147c49ccf7b9ccbe2
  • Avoid unportable strftime() behavior in pg_dump/pg_dumpall. Commit ad5d46a4494b0b480a3af246bb4227d9bdadca37 thought that we could get around the known portability issues of strftime's %Z specifier by using %z instead. However, that idea seems to have been innocent of any actual research, as it certainly missed the facts that (1) %z is not portable to pre-C99 systems, and (2) %z doesn't actually act differently from %Z on Windows anyway. Per failures on buildfarm member hamerkop. While at it, centralize the code defining what strftime format we want to use in pg_dump; three copies of that string seems a bit much. http://git.postgresql.org/pg/commitdiff/f455fcfdb8ca3b67373223a4e15648c35e2592a9

Andrew Dunstan a poussé :

  • Correct volatility markings of a few json functions. json_agg and json_object_agg and their associated transition functions should have been marked as stable rather than immutable, as they call IO functions indirectly. Changing this probably isn't going to make much difference, as you can't use an aggregate function in an index expression, but we should be correct nevertheless. json_object, on the other hand, should be marked immutable rather than stable, as it does not call IO functions. As discussed on -hackers, this change is being made without bumping the catalog version, as we don't want to do that at this stage of the cycle, and the changes are very unlikely to affect anyone. http://git.postgresql.org/pg/commitdiff/af2b8fd057213f4b1918b9581c63e0b00427573c

Peter Eisentraut a poussé :

Andres Freund a poussé :

  • Flush unlogged table's buffers when copying or moving databases. CREATE DATABASE and ALTER DATABASE .. SET TABLESPACE copy the source database directory on the filesystem level. To ensure the on disk state is consistent they block out users of the affected database and force a checkpoint to flush out all data to disk. Unfortunately, up to now, that checkpoint didn't flush out dirty buffers from unlogged relations. That bug means there could be leftover dirty buffers in either the template database, or the database in its old location. Leading to problems when accessing relations in an inconsistent state; and to possible problems during shutdown in the SET TABLESPACE case because buffers belonging files that don't exist anymore are flushed. This was reported in bug #10675 by Maxim Boguk. Fix by Pavan Deolasee, modified somewhat by me. Reviewed by MauMau and Fujii Masao. Backpatch to 9.1 where unlogged tables were introduced. http://git.postgresql.org/pg/commitdiff/7dbb60693820c20b562c12f58040c9871d6ab787
  • Renumber CHECKPOINT_* flags. Commit 7dbb6069382 added a new CHECKPOINT_FLUSH_ALL flag. As that commit needed to be backpatched I didn't change the numeric values of the existing flags as that could lead to nastly problems if any external code issued checkpoints. That's not a concern on master, so renumber them there. Also add a comment about CHECKPOINT_FLUSH_ALL above CreateCheckPoint(). http://git.postgresql.org/pg/commitdiff/11abd6c90f1094eaeee32e1c57d250c9db5102cb
  • Don't duplicate log_checkpoint messages for both of restart and checkpoints. The duplication originated in cdd46c765, where restartpoints were introduced. In LogCheckpointStart's case the duplication actually lead to the compiler's format string checking not to be effective because the format string wasn't constant. Arguably these messages shouldn't be elog(), but ereport() style messages. That'd even allow to translate the messages... But as there's more mistakes of that kind in surrounding code, it seems better to change that separately. http://git.postgresql.org/pg/commitdiff/5e5b65f359b7a12c05708585a8e6cd4d80ca2652
  • Add native compiler and memory barriers for solaris studio. Discussion: 20140925133459.GB9633@alap3.anarazel.de Author: Oskari Saarenmaa http://git.postgresql.org/pg/commitdiff/4a54b99e9c3989017fa5717f343cceab09aa5542

Noah Misch a poussé :

  • MinGW: Link with shell32.dll instead of shfolder.dll. This improves consistency with the MSVC build. On buildfarm member narwhal, since commit 846e91e0223cf9f2821c3ad4dfffffbb929cb027, shfolder.dll:SHGetFolderPath() crashes when dblink calls it by way of pqGetHomeDirectory(). Back-patch to 9.4, where that commit first appeared. How it caused this regression remains a mystery. This is a partial revert of commit 889f03812916b146ae504c0fad5afdc7bf2e8a2a, which adopted shfolder.dll for Windows NT 4.0 compatibility. PostgreSQL 8.2 dropped support for that operating system. http://git.postgresql.org/pg/commitdiff/53566fc0940cf557416b13252df57350a4511ce4
  • MinGW: Use -static-libgcc when linking a DLL. When commit 846e91e0223cf9f2821c3ad4dfffffbb929cb027 switched the linker driver from dlltool/dllwrap to gcc, it became possible for linking to choose shared libgcc. Backends having loaded a module dynamically linked to libgcc can exit abnormally, which the postmaster treats like a crash. Resume use of static libgcc exclusively, like 9.3 and earlier. Back-patch to 9.4. http://git.postgresql.org/pg/commitdiff/284590e416b72f541c5fe54f36a95e38d80835c3

Heikki Linnakangas a poussé :

  • Update comment. The _bt_tuplecompare() function mentioned in comment hasn't existed for a long time. Peter Geoghegan http://git.postgresql.org/pg/commitdiff/98b37437796bb5fedecf0d0c73cef4aa2ce9d192
  • Complain if too many options are passed to pg_controldata or pg_resetxlog. http://git.postgresql.org/pg/commitdiff/2d53003432f8560b9c3adf569118747c8ac8447d
  • Oops, the commit accept pg_controldata -D datadir missed code changes. I updated the docs and usage blurp, but forgot to commit the code changes required. Spotted by Michael Paquier. http://git.postgresql.org/pg/commitdiff/22b743b2ca18a692ba8d91bc18e7c42a8b7941ad
  • Forgot #include "pg_getopt.h", now that pg_controldata uses getopt. Needed at least on Windows. http://git.postgresql.org/pg/commitdiff/c0c1f6fc97088100a710e7e9c2e74b775985083d
  • Work around Windows locale name with non-ASCII character. Windows has one a locale whose name contains a non-ASCII character: "Norwegian (Bokmål)" (that's an 'a' with a ring on top). That causes trouble; when passing it setlocale(), it's not clear what encoding the argument should be in. Another problem is that the locale name is stored in pg_database catalog table, and the encoding used there depends on what server encoding happens to be in use when the database is created. For example, if you issue the CREATE DATABASE when connected to a UTF-8 database, the locale name is stored in pg_database in UTF-8. As long as all locale names are pure ASCII, that's not a problem. To work around that, map the troublesome locale name to a pure-ASCII alias of the same locale, "norwegian-bokmal". Now, this doesn't change the existing values that are already in pg_database and in postgresql.conf. Old clusters will need to be fixed manually. Instructions for that need to be put in the release notes. This fixes bug #11431 reported by Alon Siman-Tov. Backpatch to 9.2; backpatching further would require more work than seems worth it. http://git.postgresql.org/pg/commitdiff/db29620d4d16e08241f965ccd70d0f65883ff0de

Michael Meskes a poussé :

Fujii Masao a poussé :

  • Prevent the already-archived WAL file from being archived again. Previously the archive recovery always created .ready file for the last WAL file of the old timeline at the end of recovery even when it's restored from the archive and has .done file. That is, there was the case where the WAL file had both .ready and .done files. This caused the already-archived WAL file to be archived again. This commit prevents the archive recovery from creating .ready file for the last WAL file if it has .done file, in order to prevent it from being archived again. This bug was added when cascading replication feature was introduced, i.e., the commit 5286105800c7d5902f98f32e11b209c471c0c69c. So, back-patch to 9.2, where cascading replication was added. Reviewed by Michael Paquier http://git.postgresql.org/pg/commitdiff/c7371c4a607872c4d799e0dac0c9367574067cdc
  • Remove the unused argument of PSQLexec(). This commit simply removes the second argument of PSQLexec that was set to the same value everywhere. Comments and code blocks related to this parameter are removed. Noticed by Heikki Linnakangas, reviewed by Michael Paquier http://git.postgresql.org/pg/commitdiff/efbbbbc8b51bacd32e96c3f747dd6aa4c0e444cb

Álvaro Herrera a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Marko (johto) Tiikkaja sent in another revision of a patch to implement PGP signatures in the pgcrypto contrib extension.
  • David Wheeler sent in two revisions of a patch to add launchd support for OSX.
  • Adam Brightwell sent in another revision of a patch to add directory and file access permissions for COPY and generic file access functions.
  • Jim Nasby sent in a patch to remove a spurious set in heap_prune_chain().
  • Jim Nasby sent in a patch to optimize CacheInvalidateHeapTuple.
  • Tom Lane sent in a patch to get rid of "accept incoming network connections" prompts on OS X.
  • Teodor Sigaev sent in a patch to speed up tidbitmap by caching a page.
  • Teodor Sigaev sent in a patch to speed up tidbitmap by hashing BlockNumber.
  • Teodor Sigaev sent in a patch to add a compress method for SP-GiST.
  • David Rowley and Craig Ringer traded patches to use a higher-precision timer API on Windows when available.
  • Teodor Sigaev sent in a patch to add GIN support contains operator for ranges over scalar column.
  • Robert Haas sent in another revision of a patch to implement pg_background.
  • Andreas Karlsson sent in a patch to reduce the lock strength needed for adding foreign keys.
  • Etsuro Fujita sent in a patch to fix an incorrect comment in tablecmds.c.
  • Pavel Stehule sent in a patch to allow AS label inside a row constructor.
  • Fujii Masao sent in another revision of a patch to implement REINDEX SCHEMA.
  • Florian Pflug sent in a patch to update README.tuplock to reflect current realities.
  • Etsuro Fujita sent in another revision of a patch to allow foreign tables to be part of table inheritance hierarchies.
  • Michael Paquier sent in two revisions of a patch to fix some typos in the recvlogical documentation.
  • Peter Geoghegan sent in another revision of a patch to implement INSERT ... ON CONFLICT {UPDATE | IGNORE}.
  • Kyotaro HORIGUCHI sent in another revision of a patch to add ALTER ROLE ... CURRENT USER.
  • Jim Nasby sent in a patch to add some detail to a comment in bgworker.c.
  • Ali Akbar and Pavel Stehule traded patches to implement array_agg(array).
  • Andreas Karlsson sent in a WIP patch to use 128-bit integers for sum, avg and statistics aggregates where available.
  • Michael Paquier sent in another revision of a patch to make pg_controldata accept "-D dirname".
  • Andrew Dunstan sent in two more revisions of a patch to add strip nulls functions for json and jsonb.
  • Marti Raudsepp sent in another revision of a patch to simplify EXISTS subqueries containing LIMIT.
  • David Rowley sent in a patch to fix an issue where pset_quoted_string was broken in psql.

par N Bougain le vendredi 31 octobre 2014 à 00h59

Nouvelles hebdomadaires de PostgreSQL - 19 octobre 2014

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en octobre

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

Kevin Grittner a poussé :

  • Increase number of hash join buckets for underestimate. If we expect batching at the very beginning, we size nbuckets for "full work_mem" (see how many tuples we can get into work_mem, while not breaking NTUP_PER_BUCKET threshold). If we expect to be fine without batching, we start with the 'right' nbuckets and track the optimal nbuckets as we go (without actually resizing the hash table). Once we hit work_mem (considering the optimal nbuckets value), we keep the value. At the end of the first batch, we check whether (nbuckets != nbuckets_optimal) and resize the hash table if needed. Also, we keep this value for all batches (it's OK because it assumes full work_mem, and it makes the batchno evaluation trivial). So the resize happens only once. There could be cases where it would improve performance to allow the NTUP_PER_BUCKET threshold to be exceeded to keep everything in one batch rather than spilling to a second batch, but attempts to generate such a case have so far been unsuccessful; that issue may be addressed with a follow-on patch after further investigation. Tomas Vondra with minor format and comment cleanup by me Reviewed by Robert Haas, Heikki Linnakangas, and Kevin Grittner http://git.postgresql.org/pg/commitdiff/30d7ae3c76d2de144232ae6ab328ca86b70e72c3

Heikki Linnakangas a poussé :

  • Add --latency-limit option to pgbench. This allows transactions that take longer than specified limit to be counted separately. With --rate, transactions that are already late by the time we get to execute them are skipped altogether. Using --latency-limit with --rate allows you to "catch up" more quickly, if there's a hickup in the server causing a lot of transactions to stall momentarily. Fabien COELHO, reviewed by Rukh Meski and heavily refactored by me. http://git.postgresql.org/pg/commitdiff/98aed6c721763f2472ccd23b834baed9f83a944b
  • Fix typo in docs. Shigeru Hanada http://git.postgresql.org/pg/commitdiff/0ff5047d52ab84dad682ad140b6992c294580eb1
  • Fix deadlock with LWLockAcquireWithVar and LWLockWaitForVar. LWLockRelease should release all backends waiting with LWLockWaitForVar, even when another backend has already been woken up to acquire the lock, i.e. when releaseOK is false. LWLockWaitForVar can return as soon as the protected value changes, even if the other backend will acquire the lock. Fix that by resetting releaseOK to true in LWLockWaitForVar, whenever adding itself to the wait queue. This should fix the bug reported by MauMau, where the system occasionally hangs when there is a lot of concurrent WAL activity and a checkpoint. Backpatch to 9.4, where this code was added. http://git.postgresql.org/pg/commitdiff/e0d97d77bf0875e4d5cc7dedfe701d9999bf678c

Bruce Momjian a poussé :

Peter Eisentraut a poussé :

Álvaro Herrera a poussé :

  • pg_dump: Reduce use of global variables. Most pg_dump.c global variables, which were passed down individually to dumping routines, are now grouped as members of the new DumpOptions struct, which is used as a local variable and passed down into routines that need it. This helps future development efforts; in particular it is said to enable a mode in which a parallel pg_dump run can output multiple streams, and have them restored in parallel. Also take the opportunity to clean up the pg_dump header files somewhat, to avoid circularity. Author: Joachim Wieland, revised by Álvaro Herrera Reviewed by Peter Eisentraut http://git.postgresql.org/pg/commitdiff/0eea8047bf0e15b402b951e383e39236bdfe57d5
  • Blind attempt at fixing Win32 pg_dump issues. Per buildfarm failures http://git.postgresql.org/pg/commitdiff/076d29a1eed5fe51fb2b25b98fcde9dd7c506902

Tom Lane a poussé :

  • Print planning time only in EXPLAIN ANALYZE, not plain EXPLAIN. We've gotten enough push-back on that change to make it clear that it wasn't an especially good idea to do it like that. Revert plain EXPLAIN to its previous behavior, but keep the extra output in EXPLAIN ANALYZE. Per discussion. Internally, I set this up as a separate flag ExplainState.summary that controls printing of planning time and execution time. For now it's just copied from the ANALYZE option, but we could consider exposing it to users. http://git.postgresql.org/pg/commitdiff/90063a7612e2730f7757c2a80ba384bbe7e35c4b
  • Support timezone abbreviations that sometimes change. Up to now, PG has assumed that any given timezone abbreviation (such as "EDT") represents a constant GMT offset in the usage of any particular region; we had a way to configure what that offset was, but not for it to be changeable over time. But, as with most things horological, this view of the world is too simplistic: there are numerous regions that have at one time or another switched to a different GMT offset but kept using the same timezone abbreviation. Almost the entire Russian Federation did that a few years ago, and later this month they're going to do it again. And there are similar examples all over the world. To cope with this, invent the notion of a "dynamic timezone abbreviation", which is one that is referenced to a particular underlying timezone (as defined in the IANA timezone database) and means whatever it currently means in that zone. For zones that use or have used daylight-savings time, the standard and DST abbreviations continue to have the property that you can specify standard or DST time and get that time offset whether or not DST was theoretically in effect at the time. However, the abbreviations mean what they meant at the time in question (or most recently before that time) rather than being absolutely fixed. The standard abbreviation-list files have been changed to use this behavior for abbreviations that have actually varied in meaning since 1970. The old simple-numeric definitions are kept for abbreviations that have not changed, since they are a bit faster to resolve. While this is clearly a new feature, it seems necessary to back-patch it into all active branches, because otherwise use of Russian zone abbreviations is going to become even more problematic than it already was. This change supersedes the changes in commit 513d06ded et al to modify the fixed meanings of the Russian abbreviations; since we've not shipped that yet, this will avoid an undesirably incompatible (not to mention incorrect) change in behavior for timestamps between 2011 and 2014. This patch makes some cosmetic changes in ecpglib to keep its usage of datetime lookup tables as similar as possible to the backend code, but doesn't do anything about the increasingly obsolete set of timezone abbreviation definitions that are hard-wired into ecpglib. Whatever we do about that will likely not be appropriate material for back-patching. Also, a potential free() of a garbage pointer after an out-of-memory failure in ecpglib has been fixed. This patch also fixes pre-existing bugs in DetermineTimeZoneOffset() that caused it to produce unexpected results near a timezone transition, if both the "before" and "after" states are marked as standard time. We'd only ever thought about or tested transitions between standard and DST time, but that's not what's happening when a zone simply redefines their base GMT offset. In passing, update the SGML documentation to refer to the Olson/zoneinfo/ zic timezone database as the "IANA" database, since it's now being maintained under the auspices of IANA. http://git.postgresql.org/pg/commitdiff/b2cbced9eef20692b51a84d68d469627f4fc43ac
  • Re-pgindent src/bin/pg_dump/*. Seems to have gotten rather messy lately, as a consequence of a couple of large recent commits. http://git.postgresql.org/pg/commitdiff/7584649a1c58029a83a7a57d74cedcf1af434c97
  • Fix core dump in pg_dump --binary-upgrade on zero-column composite type. This reverts nearly all of commit 28f6cab61ab8958b1a7dfb019724687d92722538 in favor of just using the typrelid we already have in pg_dump's TypeInfo struct for the composite type. As coded, it'd crash if the composite type had no attributes, since then the query would return no rows. Back-patch to all supported versions. It seems to not really be a problem in 9.0 because that version rejects the syntax "create type t as ()", but we might as well keep the logic similar in all affected branches. Report and fix by Rushabh Lathia. http://git.postgresql.org/pg/commitdiff/5c38a1d4ecce849b1e105f59ccca5a926181e4f0
  • Avoid core dump in _outPathInfo() for Path without a parent RelOptInfo. Nearly all Paths have parents, but a ResultPath representing an empty FROM clause does not. Avoid a core dump in such cases. I believe this is only a hazard for debugging usage, not for production, else we'd have heard about it before. Nonetheless, back-patch to 9.1 where the troublesome code was introduced. Noted while poking at bug #11703. http://git.postgresql.org/pg/commitdiff/5ba062ee44c35b4dc49ccf869fe48f3c6f5f926f
  • Declare mkdtemp() only if we're providing it. Follow our usual style of providing an "extern" for a standard library function only when we're also providing the implementation. This avoids issues when the system headers declare the function slightly differently than we do, as noted by Caleb Welton. We might have to go to the extent of probing to see if the system headers declare the function, but let's not do that until it's demonstrated to be necessary. Oversight in commit 9e6b1bf258170e62dac555fc82ff0536dfe01d29. Back-patch to all supported branches, as that was. http://git.postgresql.org/pg/commitdiff/60f8133dc95d8d55ac52186eb9988559816cac49

Stephen Frost a poussé :

Fujii Masao a poussé :

  • Fix bug in handling of connections that pg_receivexlog creates. Previously pg_receivexlog created new connection for WAL streaming even though another connection which had been established to create or delete the replication slot was being left. This caused the unused connection to be left uselessly until pg_receivexlog exited. This bug was introduced by the commit d9f38c7. This patch changes pg_receivexlog so that the connection for the replication slot is reused for WAL streaming. Andres Freund, slightly modified by me, reviewed by Michael Paquier http://git.postgresql.org/pg/commitdiff/504c717599b20cdaf09e9d7b6ecd152cc7a3a71a

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Petr (PJMODOS) Jelinek sent in another revision of a patch to track commit timestamps.
  • Petr (PJMODOS) Jelinek sent in a patch to add an access method for sequences.
  • Andrew Dunstan and Pavel Stehule traded patches to add some missing functionality to JSON[B].
  • Michael Paquier sent in another revision of a patch to add generate_series(numeric, numeric).
  • Michael Paquier sent in another revision of a patch to split builtins.h to quote.h.
  • SAWADA Masahiko sent in a patch to drop any statistics of a table after it's truncated.
  • Fabrízio de Royes Mello sent in another revision of a patch to add CINE for materialized views.
  • Marco Nenciarini sent in another WIP revision of a patch to implement incremental backup.
  • Marti Raudsepp sent in a patch to unify checks for catalog modification.
  • Amit Kapila sent in another revision of a patch to scale shared buffer eviction.
  • Etsuro Fujita sent in two more revisions of a patch to allow foreign tables to be in a table inheritance hierarchy.
  • Dimitri Fontaine sent in two revisions of a patch to add a new type of event trigger: table_rewrite.
  • Robert Haas sent in a patch to implement group locking, a support for parallelism.
  • Stephen Frost sent in a patch to add a few additional role attributes (all requested by users or clients in various forums) for common operations which currently require superuser privileges.
  • Robert Haas sent in a WIP patch to create a dynahash replacement for buffer table.
  • Abhijit Menon-Sen sent in another revision of a patch to implement pg_audit, an extension.
  • David Rowley sent in another revision of a patch to enable inner join removals under certain conditions.
  • Alexander Korotkov sent in a WIP patch to re-add access method extensibility, and an extension using this machinery.
  • Álvaro Herrera sent in another revision of a patch to enable replicating DROP commands across servers.
  • Lucas Lersch sent in a patch to log buffer request trace data.
  • Atri Sharma sent in a patch to implement UPDATE table SET(*)= and similar constructs.
  • Adam Brightwell sent in a patch to implement a directory permission system that allows for providing a directory read/write capability to directories for COPY TO/FROM and Generic File Access Functions to non-superusers.
  • Jeff Davis sent in another revision of a patch to allow better memory accounting for use in an eventual memory-bounded hash aggregate.
  • SAWADA Masahiko and Fabrízio de Royes Mello traded patches to implement REINDEX SCHEMA.
  • Michael Banck sent in a patch to log a notice that checkpoint is to be written on shutdown.
  • Michael Paquier sent in another revision of a patch to give better support of exported snapshots to pg_dump.
  • Rahila Syed sent in another revision of a patch to compress full-page writes.
  • Craig Ringer sent in a patch to detect custom-format dumps in psql and emit a useful error.
  • Pavel Stehule sent in another revision of a patch to add an Assert statement to PL/pgsql.
  • Craig Ringer sent in a patch to add an errhint_log, akin to errdetail_log. This allows 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.
  • Furuya Osamu sent in another revision of a patch to pg_receivexlog --status-interval to add fsync feedback.
  • Fujii Masao sent in a patch to fix an infelicity between RETURNING and POLICY.
  • Fujii Masao sent in a patch to fix a bug in recovery mode.
  • Andreas 'ads' Scherbaum sent in another revision of a patch to better describe PostgreSQL's rounding behavior.
  • Dag-Erling Smørgrav sent in a patch to add ssl_protocols configuration option.
  • Adam Brightwell sent in another revision of a patch to add a has_privs_of_role() function.
  • Ali Akbar sent in another revision of a patch to add array_agg() functionality for array types.
  • Emre Hasegeli sent in a patch to add a BRIN range operator class.
  • Marko (johto) Tiikkaja sent in a patch to fix a bug where a comment in the pg_crypto extension refers to the wrong file.

par N Bougain le vendredi 31 octobre 2014 à 00h48

vendredi 17 octobre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 12 otobre 2014

PostgreSQL 9.4 Beta 3 publiée. TEST ! http://www.postgresql.org/about/news/1547/

L'appel à conférenciers pour la PGConf NYC 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/

[ndt: meetup à Lyon le 19 novembre : http://www.meetup.com/PostgreSQL-User-Group-Lyon/events/214027472/]

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en octobre

PostgreSQL Local

  • La cinquième édition du PgDay argentin est programmée pour le 28 novembre 2014 à Santa Fe. L'appel international à conférenciers court jusqu'au 28 septembre : http://www.postgresql.org.ar/pgday2014
  • Le 4ème PgDay équatorien aura lieu le mardi 7 octobre en la ville de Quito, intégré au 5ème congrès international du Logiciel Libre. Envoyez vos propositions de conférences à ecpug AT postgresql DOT org.
  • Le sixième PGDay cubain aura lieu les 13 et 14 octobre 2014 à la Havane : https://postgresql.uci.cu/?p=380
  • Les inscriptions pour la PGConf.EU 2014 de Madrid, Espagne, du 21 au 24 octobre sont à présent ouvertes : http://2014.pgconf.eu/registration/
  • Le PGDay.IT 2014 aura lieu à Prato le 7 novembre 2014. L'appel international à conférenciers a été lancé : http://2014.pgday.it/call-for-papers-en/

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

Andres Freund a poussé :

  • Rename pg_recvlogical's --create/--drop to --create-slot/--drop-slot. A future patch (9.5 only) adds slot management to pg_receivexlog. The verbs create/drop don't seem descriptive enough there. It seems better to rename pg_recvlogical's commands now, in beta, than live with the inconsistency forever. The old form (e.g. --drop) will still be accepted by virtue of most getopt_long() options accepting abbreviations for long commands. Backpatch to 9.4 where pg_recvlogical was introduced. Author: Michael Paquier and Andres Freund Discussion: CAB7nPqQtt79U6FmhwvgqJmNyWcVCbbV-nS72j_jyPEopERg9rg@mail.gmail.com http://git.postgresql.org/pg/commitdiff/c8b6cba84a986ae9154f748e44709a17d6723191
  • Add support for managing physical replication slots to pg_receivexlog. pg_receivexlog already has the capability to use a replication slot to reserve WAL on the upstream node. But the used slot currently has to be created via SQL. To allow using slots directly, without involving SQL, add --create-slot and --drop-slot actions, analogous to the logical slot manipulation support in pg_recvlogical. Author: Michael Paquier Discussion: CABUevEx+zrOHZOQg+dPapNPFRJdsk59b=TSVf30Z71GnFXhQaw@mail.gmail.com http://git.postgresql.org/pg/commitdiff/d9f38c7a555dd5a6b81100c6d1e4aa68342d8771

Stephen Frost a poussé :

  • Clean up Create/DropReplicationSlot query buffer. CreateReplicationSlot() and DropReplicationSlot() were not cleaning up the query buffer in some cases (mostly error conditions) which meant a small leak. Not generally an issue as the error case would result in an immediate exit, but not difficult to fix either and reduces the number of false positives from code analyzers. In passing, also add appropriate PQclear() calls to RunIdentifySystem(). Pointed out by Coverity. http://git.postgresql.org/pg/commitdiff/273b29dbe96b1584dd66615cf8dc83e7e6ae7386

Tom Lane a poussé :

  • Fix array overrun in ecpg's version of ParseDateTime(). The code wrote a value into the caller's field[] array before checking to see if there was room, which of course is backwards. Per report from Michael Paquier. I fixed the equivalent bug in the backend's version of this code way back in 630684d3a130bb93, but failed to think about ecpg's copy. Fortunately this doesn't look like it would be exploitable for anything worse than a core dump: an external attacker would have no control over the single word that gets written. http://git.postgresql.org/pg/commitdiff/55bfdd1cfd991af0864535bbca24a606e8be7e45
  • Fix bogus optimization in JSONB containment tests. When determining whether one JSONB object contains another, it's okay to make a quick exit if the first object has fewer pairs than the second: because we de-duplicate keys within objects, it is impossible that the first object has all the keys the second does. However, the code was applying this rule to JSONB arrays as well, where it does *not* hold because arrays can contain duplicate entries. The test was really in the wrong place anyway; we should do it within JsonbDeepContains, where it can be applied to nested objects not only top-level ones. Report and test cases by Alexander Korotkov; fix by Peter Geoghegan and Tom Lane. http://git.postgresql.org/pg/commitdiff/4a50de13127b7657f32f14dc17beb2e15a3a4777
  • Improve documentation about JSONB array containment behavior. Per gripe from Josh Berkus. http://git.postgresql.org/pg/commitdiff/25ad5a52847699527ddba6e86aa353075e578e9b

Robert Haas a poussé :

  • Fix typo in elog message. http://git.postgresql.org/pg/commitdiff/c421efd21330f2e5bed253b4a53d7ea5e084edf6
  • Extend shm_mq API with new functions shm_mq_sendv, shm_mq_set_handle. shm_mq_sendv sends a message to the queue assembled from multiple locations. This is expected to be used by forthcoming patches to allow frontend/backend protocol messages to be sent via shm_mq, but might be useful for other purposes as well. shm_mq_set_handle associates a BackgroundWorkerHandle with an already-existing shm_mq_handle. This solves a timing problem when creating a shm_mq to communicate with a newly-launched background worker: if you attach to the queue first, and the background worker fails to start, you might block forever trying to do I/O on the queue; but if you start the background worker first, but then die before attaching to the queue, the background worrker might block forever trying to do I/O on the queue. This lets you attach before starting the worker (so that the worker is protected) and then associate the BackgroundWorkerHandle later (so that you are also protected). Patch by me, reviewed by Stephen Frost. http://git.postgresql.org/pg/commitdiff/7bb0e97407c32cbf7245ef91fcc27d120c81e872

Álvaro Herrera a poussé :

  • Implement SKIP LOCKED for row-level locks This clause changes the behavior of SELECT locking clauses in the presence of locked rows: instead of causing a process to block waiting for the locks held by other processes (or raise an error, with NOWAIT), SKIP LOCKED makes the new reader skip over such rows. While this is not appropriate behavior for general purposes, there are some cases in which it is useful, such as queue-like tables. Catalog version bumped because this patch changes the representation of stored rules. Reviewed by Craig Ringer (based on a previous attempt at an implementation by Simon Riggs, who also provided input on the syntax used in the current patch), David Rowley, and Álvaro Herrera. Author: Thomas Munro http://git.postgresql.org/pg/commitdiff/df630b0dd5ea2de52972d456f5978a012436115e
  • Split builtins.h to a new header ruleutils.h. The new header contains many prototypes for functions in ruleutils.c that are not exposed to the SQL level. Reviewed by Andres Freund and Michael Paquier. http://git.postgresql.org/pg/commitdiff/7b1c2a0f2066672b24f6257ec9b8d78a1754f494

Fujii Masao a poussé :

Heikki Linnakangas a poussé :

  • Change the way encoding and locale checks are done in pg_upgrade. Lc_collate and lc_ctype have been per-database settings since server version 8.4, but pg_upgrade was still treating them as cluster-wide options. It fetched the values for the template0 databases in old and new cluster, and compared them. That's backwards; the encoding and locale of the template0 database doesn't matter, as template0 is guaranteed to contain only ASCII characters. But if there are any other databases that exist on both clusters (in particular template1 and postgres databases), their encodings and locales must be compatible. Also, make the locale comparison more lenient. If the locale names are not equal, try to canonicalize both of them by passing them to setlocale(). We used to do that only when upgrading from 9.1 or below, but it seems like a good idea even with newer versions. If we change the canonical form of a locale, this allows pg_upgrade to still work. I'm about to do just that to fix bug #11431, by mapping a locale name that contains non-ASCII characters to a pure-ASCII alias of the same locale. No backpatching, because earlier versions of pg_upgrade still support upgrading from 8.3 servers. That would be more complicated, so it doesn't seem worth it, given that we haven't received any complaints about this from users. http://git.postgresql.org/pg/commitdiff/33755e8edf149dabfc0ed9b697a84f70b0cca0de
  • Remove unnecessary initialization of local variables. Oops, forgot these in the previous commit. http://git.postgresql.org/pg/commitdiff/733be2a5cd124b28a15d5d09de9b227691e6c5a0

Bruce Momjian a poussé :

Peter Eisentraut a poussé :

Noah Misch a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Etsuro Fujita sent in a patch to improve the autoanalyze messages on inheritance trees.
  • Heikki Linnakangas sent in another revision of a patch to change the format and API of WALs.
  • Heikki Linnakangas sent in another revision of a patch to implement an SSL regression test suite.
  • Fabrízio de Royes Mello sent in another revision of a patch to implement CINE for indexes.
  • Ali Akbar sent in two more revisions of a patch to implement generate_series(numeric, numeric).
  • Ali Akbar sent in another revision of a patch to fix xpath() to return namespace definitions.
  • Dilip Kumar sent in another revision of a patch to allow parallel cores to be used by vacuumdb.
  • Álvaro Herrera sent in another revision of a patch to implement BRIN indexes.
  • Feike Steenbergen sent in a patch to add regression tests for autocommit-off mode for psql and fix some omissions, and another to backpatch it to 9.2+.
  • Peter Geoghegan sent in another revision of a patch to implement (INSERT|UPDATE) ... ON CONFLICT...
  • Heikki Linnakangas sent in a patch to implement page inspection functions for GIN indexes.
  • Tom Lane sent in a patch to help fix the mess that is timezone abbreviations.
  • Álvaro Herrera sent in three more revisions of a patch to refactor pg_dump to remove global variables.
  • Fujii Masao sent in another revision of a patch to add a pending_list_cleanup_size GUC and associated machinery.
  • Heikki Linnakangas sent in a patch to fix the CRC algorithm so it matches what the documents say it is.
  • Michael Paquier sent in three more revisions of a patch to ensure that .ready files not appear on replicas.
  • Robert Haas sent in two patches to defer some AtStart* allocations.
  • Kyotaro HORIGUCHI sent in another revision of a patch to fix a situation where it was impossible to escape from a blocked send().
  • Andres Freund sent in three more revisions of a patch to implement wait-free LW_SHARED acquisition.
  • Heikki Linnakangas sent in another revision of a patch to add a throttling latency limit to pgbench.
  • Fujii Masao sent in a patch to allow ALTER ROLE/DATABASE SET to set PGC_BACKEND and PGC_SU_BACKEND parameters.
  • Amit Kapila sent in another revision of a patch to scale buffer eviction.
  • Peter Geoghegan sent in a patch to remove an obsolete reference to _bt_tuplecompare() within tuplesort.c.
  • Kyotaro HORIGUCHI sent in a patch to arrange things so ALTER USER/ROLE now takes CURRENT_USER as user name, rewrite the sysnopsis of the documents for ALTER USER and ALTER ROLE so as to they have exactly same syntax, and modify the syntax of ALTER USER so as to be an alias of ALTER ROLE.
  • Craig Ringer sent in another revision of a patch to use a faster, higher precision timer API on Windows.
  • Michael Paquier sent in a patch to fix some docs around row-level locking.
  • Peter Geoghegan sent in a patch to see that B-Tree index builds use sortsupport.
  • Noah Misch sent in a patch to fix an error caused by the fact that Darwin's setlocale() can start a thread.
  • Fabrízio de Royes Mello sent in a patch to get rid the toast table for pg_seclabel.
  • Peter Geoghegan sent in a patch to make B-Tree and CLUSTER sortsupport use abbreviation and fix PG_CACHE_LINE_SIZE bit rot.
  • Bruce Momjian and Peter Eisentraut traded patches to deal with some psql output changes in 9.4-to-be.
  • Ali Akbar sent in two revisions of a patch to create array_agg() for arrays.
  • Michael Paquier sent in a patch to create a new header quote.h in include/utils that groups all the quote-related functions.
  • Tomas Vondra sent in a WIP patch to implement multivariate statistics.
  • Álvaro Herrera sent in another revision of a patch to add CREATE support to event triggers.
  • SAWADA Masahiko sent in a patch to implement REINDEX SCHEMA.

par N Bougain le vendredi 17 octobre 2014 à 20h58

mardi 14 octobre 2014

Actualités PostgreSQL.fr

Publication de PostgreSQL 9.4 bêta 3

Le « PostgreSQL Global Development Group » vient de publier la version 9.4 bêta 3, la nouvelle révision bêta de la prochaine version.

Cette bêta présente toutes les fonctionnalités qui seront disponibles dans la version 9.4, ainsi que les correctifs de la plupart des problèmes rencontrés pas les utilisateurs qui ont testé la bêta 2. Nous vous invitons à télécharger, tester, et signaler ce que vous trouverez.

Le changement principal dans la bêta 3 est la modification du type de format de données pour JSONB, afin de rendre les champs JSONB plus faciles à compacter et de réduire l'espace de stockage nécessaire. Ce changement n'est pas rétrocompatible. Les utilisateurs qui ont chargé des données dans les champs JSONB, en utilisant la 9.4 bêta 1 ou bêta 2, devront utiliser pg_dump et lancer une restauration pour passer en bêta 3.

Parmi les autres changements faits depuis la bêta 2, citons :

  • Changement des arguments de pg_recvlogical --create/--drop en --create-slot/--drop-slot
  • Éviter le délai excessif au démarrage du « background worker »
  • Suppression du paramètre de configuration num_xloginsert_locks, remplacé par #define
  • Correction de l'option --if-exists de pg_dump pour les « large objects »
  • Suppression de l'interdiction des clés d'objet JSON de taille nulle
  • Retour de NULL par json_object_agg s'il n'y a pas de ligne
  • Les instructions ALTER SYSTEM sont tracées comme des DDL
  • Correction de l'impossibilité pour la contribution auto_explain à afficher les informations temporelles par nœud
  • Plusieurs correctifs des vérifications TAP
  • Support de la commande ALTER SYSTEM RESET
  • Correctif de power_var_int() pour les exposants d'entiers long
  • Correctif pour vacuumdb --analyze-in-stages --all
  • Modification de la façon dont la latence est calculée avec l'option --rate de pgbench
  • Support de ALTER ... ALL IN pour les déclencheurs sur événement
  • Suppression de la restriction aux seuls superutilisateurs pour pg_is_xlog_replay_paused()
  • Correction de FOR UPDATE NOWAIT sur les chaînes de tuples actualisés
  • Correction de la gestion des Var pour les vues de barrière de sécurité
  • Correction des rafraichissements concurrents de niveau superutilisateur pour les vues matérialisées appartenant à autrui
  • Pas de suivi des DEALLOCATE dans pg_stat_statements
  • Correction du comportement aux limites des opérateurs d'extraction JSON/JSONB
  • Modification de la façon dont la cartographie des « tablespace » est effectuée par pg_basebackup
  • Refonte du MOVE ALL en ALTER ALL ... IN TABLESPACE
  • Correction du core dump de l'opérateur jsonb
  • Abandon des modifications du psql pour supporter le mode étendu à retour chariot
  • Ajout de l'option -S pour pg_receivexlog
  • Rejet des doublons de noms de colonnes dans les listes de colonnes référencées par les clés étrangères
  • Correction du crash du checkpointer
  • Multiples corrections mineures sur JSON et les fonctionnalités JSONB
  • Multiples corrections mineures sur le décodage logique
  • De multiples corrections de bugs concernant d'anciens problèmes sont à venir dans une prochaine version mineure
  • Également des améliorations et modifications dans la documentation

La bêta 3 inclut des changements sur pg_control et les catalogues système. De fait, les utilisateurs ayant testé la bêta 1 ou la bêta 2 devront les mettre à jour pour tester la bêta 3. Nous suggérons d'utiliser pg_upgrade pour cette mise à jour afin de le tester également.

Pour une liste complète des fonctionnalités de la version 9.4 bêta, veuillez consulter les notes de version http://www.postgresql.org/docs/devel/static/release-9-4.html.

Des descriptions et notes additionnelles des nouvelles fonctionnalités sont disponibles sur la page wiki des fonctionnalités 9.4 :
http://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.4.

Nous avons besoin de notre communauté pour nous aider à tester la prochaine version afin de garantir qu'elle a de bonnes performances et qu'elle est exempte de bogues.

Nous vous invitons à télécharger PostgreSQL 9.4 bêta 3 et à l'essayer avec vos projets et applications dès que possible, puis à faire vos retours et critiques aux développeurs PostgreSQL.

Les fonctionnalités et APIs de la bêta 3 ne changeront pas de manière substantielle avant la version finale, il est donc possible de créer des applications autour des nouvelles fonctionnalités en toute sécurité.

Plus d'informations sur la manière de tester et de signaler les problèmes http://www.postgresql.org/developer/beta.

Vous trouverez la bêta 3 de PostgreSQL 9.4, comprenant les binaires et les installeurs pour Windows, Linux et Mac, sur la page de téléchargement http://www.postgresql.org/download.

La documentation complète de la nouvelle version, disponible en ligne http://www.postgresql.org/docs/9.4/static/, est également installée avec postgreSQL.

par SAS le mardi 14 octobre 2014 à 18h27

jeudi 9 octobre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 5 octobre 2014

La PGCon 2015 aura lieu en juin, quelques semaines plus tard par rapport aux années précédentes. Le site web sera bientôt mis à jour. Entre temps, veuillez lire : https://plus.google.com/109158564828766727391/posts/5VrpSxoZDAa

Federico Campoli parlera de PostgreSQL et de Big Data lors du Linux Day italien de Ferrara, le 25 octobre 2014 : http://www.pgdba.co.uk/2014/10/postgresql-and-big-data-talk.html

Notez les dates : la seconde conférence PostgreSQLienne suisse aura lieu les 25 & 26 juin 2015 au HSR Rapperswil. Il y aura une journée dédiée aux tutoriels, et une journée pour les présentations "normales". Plus de détails sous peu.

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en octobre

PostgreSQL Local

  • La cinquième édition du PgDay argentin est programmée pour le 28 novembre 2014 à Santa Fe. L'appel international à conférenciers court jusqu'au 28 septembre : http://www.postgresql.org.ar/pgday2014
  • Le 4ème PgDay équatorien aura lieu le mardi 7 octobre en la ville de Quito, intégré au 5ème congrès international du Logiciel Libre. Envoyez vos propositions de conférences à ecpug AT postgresql DOT org.
  • Le sixième PGDay cubain aura lieu les 13 et 14 octobre 2014 à la Havane : https://postgresql.uci.cu/?p=380
  • Les inscriptions pour la PGConf.EU 2014 de Madrid, Espagne, du 21 au 24 octobre sont à présent ouvertes : http://2014.pgconf.eu/registration/
  • Le PGDay.IT 2014 aura lieu à Prato le 7 novembre 2014. L'appel international à conférenciers a été lancé : http://2014.pgday.it/call-for-papers-en/

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

Stephen Frost a poussé :

  • Revert 95d737ff to add 'ignore_nulls'. Per discussion, revert the commit which added 'ignore_nulls' to row_to_json. This capability would be better added as an independent function rather than being bolted on to row_to_json. Additionally, the implementation didn't address complex JSON objects, and so was incomplete anyway. Pointed out by Tom and discussed with Andrew and Robert. http://git.postgresql.org/pg/commitdiff/c8a026e4f15e2063cd7fe6cb9ffe44f2a81398bd
  • Also revert e3ec0728, JSON regression tests. Managed to forget to update the other JSON regression test output, again. Revert the commit which fixed it before. Per buildfarm. http://git.postgresql.org/pg/commitdiff/08da8947f4b52ad41770f260a3962b032de77120
  • Correct stdin/stdout usage in COPY .. PROGRAM The COPY documentation incorrectly stated, for the PROGRAM case, that we read from stdin and wrote to stdout. Fix that, and improve consistency by referring to the 'PostgreSQL' user instead of the 'postgres' user, as is done in the rest of the COPY documentation. Pointed out by Peter van Dijk. Back-patch to 9.3 where COPY .. PROGRAM was introduced. http://git.postgresql.org/pg/commitdiff/8492d86342915cb466eeb2d896d9b49887f59350
  • Fix CreatePolicy, pg_dump -v; psql and doc updates. Peter Geoghegan pointed out that valgrind was, rightfully, complaining about CreatePolicy() ending up copying beyond the end of the parsed policy name. Name is a fixed-size type and we need to use namein (through DirectFunctionCall1()) to flush out the entire array before we pass it down to heap_form_tuple. Michael Paquier pointed out that pg_dump --verbose was missing a newline and Fabrízio de Royes Mello further pointed out that the schema was also missing from the messages, so fix those also. Also, based on an off-list comment from Kevin, rework the psql \d output to facilitate copy/pasting into a new CREATE or ALTER POLICY command. Lastly, improve the pg_policies view and update the documentation for it, along with a few other minor doc corrections based on an off-list discussion with Adam Brightwell. http://git.postgresql.org/pg/commitdiff/78d72563ef141ddc507ddd5ae77db613a309041a

Tom Lane a poussé :

  • Change JSONB's on-disk format for improved performance. The original design used an array of offsets into the variable-length portion of a JSONB container. However, such an array is basically uncompressible by simple compression techniques such as TOAST's LZ compressor. That's bad enough, but because the offset array is at the front, it tended to trigger the give-up-after-1KB heuristic in the TOAST code, so that the entire JSONB object was stored uncompressed; which was the root cause of bug #11109 from Larry White. To fix without losing the ability to extract a random array element in O(1) time, change this scheme so that most of the JEntry array elements hold lengths rather than offsets. With data that's compressible at all, there tend to be fewer distinct element lengths, so that there is scope for compression of the JEntry array. Every N'th entry is still an offset. To determine the length or offset of any specific element, we might have to examine up to N preceding JEntrys, but that's still O(1) so far as the total container size is concerned. Testing shows that this cost is negligible compared to other costs of accessing a JSONB field, and that the method does largely fix the incompressible-data problem. While at it, rearrange the order of elements in a JSONB object so that it's "all the keys, then all the values" not alternating keys and values. This doesn't really make much difference right at the moment, but it will allow providing a fast path for extracting individual object fields from large JSONB values stored EXTERNAL (ie, uncompressed), analogously to the existing optimization for substring extraction from large EXTERNAL text values. Bump catversion to denote the incompatibility in on-disk format. We will need to fix pg_upgrade to disallow upgrading jsonb data stored with 9.4 betas 1 and 2. Heikki Linnakangas and Tom Lane http://git.postgresql.org/pg/commitdiff/def4c28cf9147472ba4cfc5b68a098d7a29fb0fb
  • Fix some more problems with nested append relations. As of commit a87c72915 (which later got backpatched as far as 9.1), we're explicitly supporting the notion that append relations can be nested; this can occur when UNION ALL constructs are nested, or when a UNION ALL contains a table with inheritance children. Bug #11457 from Nelson Page, as well as an earlier report from Elvis Pranskevichus, showed that there were still nasty bugs associated with such cases: in particular the EquivalenceClass mechanism could try to generate "join" clauses connecting an appendrel child to some grandparent appendrel, which would result in assertion failures or bogus plans. Upon investigation I concluded that all current callers of find_childrel_appendrelinfo() need to be fixed to explicitly consider multiple levels of parent appendrels. The most complex fix was in processing of "broken" EquivalenceClasses, which are ECs for which we have been unable to generate all the derived equality clauses we would like to because of missing cross-type equality operators in the underlying btree operator family. That code path is more or less entirely untested by the regression tests to date, because no standard opfamilies have such holes in them. So I wrote a new regression test script to try to exercise it a bit, which turned out to be quite a worthwhile activity as it exposed existing bugs in all supported branches. The present patch is essentially the same as far back as 9.2, which is where parameterized paths were introduced. In 9.0 and 9.1, we only need to back-patch a small fragment of commit 5b7b5518d, which fixes failure to propagate out the original WHERE clauses when a broken Emmanuel Cecchet contains constant members. (The regression test case results show that these older branches are noticeably stupider than 9.2+ in terms of the quality of the plans generated; but we don't really care about plan quality in such cases, only that the plan not be outright wrong. A more invasive fix in the older branches would not be a good idea anyway from a plan-stability standpoint.) http://git.postgresql.org/pg/commitdiff/5a6c168c7859e150c61e30b7519471045bab065e
  • Fix bogus logic for zic -P option. The quick hack I added to zic to dump out currently-in-use timezone abbreviations turns out to have a nasty bug: within each zone, it was printing the last "struct ttinfo" to be *defined*, not necessarily the last one in use. This was mainly a problem in zones that had changed the meaning of their zone abbreviation (to another GMT offset value) and later changed it back. As a result of this error, we'd missed out updating the tznames/ files for some jurisdictions that have changed their zone abbreviations since the tznames/ files were originally created. I'll address the missing data updates in a separate commit. http://git.postgresql.org/pg/commitdiff/596857043023738099d6d16f8edbe6b7353876c0
  • Update time zone abbreviations lists. This updates known_abbrevs.txt to be what it should have been already, were my -P patch not broken; and updates some tznames/ entries that missed getting any love in previous timezone data updates because zic failed to flag the change of abbreviation. The non-cosmetic updates: * Remove references to "ADT" as "Arabia Daylight Time", an * abbreviation that's been out of use since 2007; therefore, claiming there is a conflict with "Atlantic Daylight Time" doesn't seem especially helpful. (We have left obsolete entries in the files when they didn't conflict with anything, but that seems like a different situation.) * Fix entirely incorrect GMT offsets for CKT (Cook Islands), FJT, FJST (Fiji); we didn't even have them on the proper side of the date line. (Seems to have been aboriginal errors in our tznames data; there's no evidence anything actually changed recently.) * FKST (Falkland Islands Summer Time) is now used all year round, so don't mark it as a DST abbreviation. * Update SAKT (Sakhalin) to mean GMT+11 not GMT+10. In cosmetic changes, I fixed a bunch of wrong (or at least obsolete) claims about abbreviations not being present in the zic files, and tried to be consistent about how obsolete abbreviations are labeled. Note the underlying timezone/data files are still at release 2014e; this is just trying to get us in sync with what those files actually say before we go to the next update. http://git.postgresql.org/pg/commitdiff/4f499eee9d4b30e761b04fa28406578c10b4badf
  • Update time zone data files to tzdata release 2014h. Most zones in the Russian Federation are subtracting one or two hours as of 2014-10-26. Update the meanings of the abbreviations IRKT, KRAT, MAGT, MSK, NOVT, OMST, SAKT, VLAT, YAKT, YEKT to match. The IANA timezone database has adopted abbreviations of the form AxST/AxDT for all Australian time zones, reflecting what they believe to be current majority practice Down Under. These names do not conflict with usage elsewhere (other than ACST for Acre Summer Time, which has been in disuse since 1994). Accordingly, adopt these names into our "Default" timezone abbreviation set. The "Australia" abbreviation set now contains only CST,EAST,EST,SAST,SAT,WST, all of which are thought to be mostly historical usage. Note that SAST has also been changed to be South Africa Standard Time in the "Default" abbreviation set. Add zone abbreviations SRET (Asia/Srednekolymsk) and XJT (Asia/Urumqi), and use WSST/WSDT for western Samoa. Also a DST law change in the Turks & Caicos Islands (America/Grand_Turk), and numerous corrections for historical time zone data. http://git.postgresql.org/pg/commitdiff/513d06ded1b44206903b87dabefee5a97243ba67
  • Update 9.4 release notes for commits through today. Add entries for recent changes, including noting the JSONB format change and the recent timezone data changes. We should remove those two items before 9.4 final: the JSONB change will be of no interest in the long run, and it's not normally our habit to mention timezone updates in major-release notes. But it seems important to document them temporarily for beta testers. I failed to resist the temptation to wordsmith a couple of existing entries, too. http://git.postgresql.org/pg/commitdiff/f706f2c1a06dfd3fe69194a93d417ca4be8951b1

Andres Freund a poussé :

  • doc fix for pg_recvlogical: --create doesn't immediately exit. Author: Michael Paquier http://git.postgresql.org/pg/commitdiff/445d262852f7aa83f9973a13bd56320d3a63842c
  • Rename CACHE_LINE_SIZE to PG_CACHE_LINE_SIZE. As noted in http://bugs.debian.org/763098 there is a conflict between postgres' definition of CACHE_LINE_SIZE and the definition by various *bsd platforms. It's debatable who has the right to define such a name, but postgres' use was only introduced in 375d8526f290 (9.4), so it seems like a good idea to rename it. Discussion: 20140930195756.GC27407@msg.df7cb.de Per complaint of Christoph Berg in the above email, although he's not the original bug reporter. Backpatch to 9.4 where the define was introduced. http://git.postgresql.org/pg/commitdiff/ef8863844bb0b0dab7b92c5f278302a42b4bf05a
  • Improve documentation about binary/textual output mode for output plugins. Also improve related error message as it contributed to the confusion. Discussion: CAB7nPqQrqFzjqCjxu4GZzTrD9kpj6HMn9G5aOOMwt1WZ8NfqeA@mail.gmail.com, CAB7nPqQXc_+g95zWnqaa=mVQ4d3BVRs6T41frcEYi2ocUrR3+A@mail.gmail.com Per discussion between Michael Paquier, Robert Haas and Andres Freund. Backpatch to 9.4 where logical decoding was introduced. http://git.postgresql.org/pg/commitdiff/0ef3c29a4b43e72d93cff65a17a9ccccff87618d
  • Block signals while computing the sleep time in postmaster's main loop. DetermineSleepTime() was previously called without blocked signals. That's not good, because it allows signal handlers to interrupt its workings. DetermineSleepTime() was added in 9.3 with the addition of background workers (da07a1e856511), where it only read from BackgroundWorkerList. Since 9.4, where dynamic background workers were added (7f7485a0cde), the list is also manipulated in DetermineSleepTime(). That's bad because the list now can be persistently corrupted if modified by both a signal handler and DetermineSleepTime(). This was discovered during the investigation of hangs on buildfarm member anole. It's unclear whether this bug is the source of these hangs or not, but it's worth fixing either way. I have confirmed that it can cause crashes. It luckily looks like this only can cause problems when bgworkers are actively used. Discussion: 20140929193733.GB14400@awork2.anarazel.de Backpatch to 9.3 where background workers were introduced. http://git.postgresql.org/pg/commitdiff/a39e78b710eb588e102aedd2828611d7bc74714b
  • pg_recvlogical.c code review. Several comments still referred to 'initiating', 'freeing', 'stopping' replication slots. These were terms used during different phases of the development of logical decoding, but are no long accurate. Also rename StreamLog() to StreamLogicalLog() and add 'void' to the prototype. Author: Michael Paquier, with some editing by me. Backpatch to 9.4 where pg_recvlogical was introduced. http://git.postgresql.org/pg/commitdiff/fdf81c9a6cf94921084e52c8d2ff903bae362620
  • Install all headers for the new atomics API. Previously, by mistake, only atomics.h was installed. Kohei KaiGai http://git.postgresql.org/pg/commitdiff/952872698d9443fdf9b808a1376017f00c91065a
  • Refactor replication connection code of various pg_basebackup utilities. Move some more code to manage replication connection command to streamutil.c. A later patch will introduce replication slot via pg_receivexlog and this avoid duplicating relevant code between pg_receivexlog and pg_recvlogical. Author: Michael Paquier, with some editing by me. http://git.postgresql.org/pg/commitdiff/0c013e08cfbebd35ec982c4df15d44b521094d52

Bruce Momjian a poussé :

Álvaro Herrera a poussé :

  • Fix pg_dump's --if-exists for large objects. This was born broken in 9067310cc5dd590e36c2c3219dbf3961d7c9f8cb. Per trouble report from Joachim Wieland. Pavel Stěhule and Álvaro Herrera http://git.postgresql.org/pg/commitdiff/fd02931a6c83bf3beb2d03f65700600787d569a3
  • Don't balance vacuum cost delay when per-table settings are in effect. When there are cost-delay-related storage options set for a table, trying to make that table participate in the autovacuum cost-limit balancing algorithm produces undesirable results: instead of using the configured values, the global values are always used, as illustrated by Mark Kirkwood in http://www.postgresql.org/message-id/52FACF15.8020507@catalyst.net.nz Since the mechanism is already complicated, just disable it for those cases rather than trying to make it cope. There are undesirable side-effects from this too, namely that the total I/O impact on the system will be higher whenever such tables are vacuumed. However, this is seen as less harmful than slowing down vacuum, because that would cause bloat to accumulate. Anyway, in the new system it is possible to tweak options to get the precise behavior one wants, whereas with the previous system one was simply hosed. This has been broken forever, so backpatch to all supported branches. This might affect systems where cost_limit and cost_delay have been set for individual tables. http://git.postgresql.org/pg/commitdiff/1021bd6a89bc756c2a72b29eeee1a7a5c25f64f5

Heikki Linnakangas a poussé :

Robert Haas a poussé :

  • Increase the number of buffer mapping partitions to 128. Testing by Amit Kapila, Andres Freund, and myself, with and without other patches that also aim to improve scalability, seems to indicate that this change is a significant win over the current value and over smaller values such as 64. It's not clear how high we can push this value before it starts to have negative side-effects elsewhere, but going this far looks OK. http://git.postgresql.org/pg/commitdiff/3acc10c997f916f6a741d0b4876126b7b08e3892
  • Still another typo fix for 0709b7ee72e4bc71ad07b7120acd117265ab51d0. Buildfarm member anole caught this one. http://git.postgresql.org/pg/commitdiff/9019264f2e2f87c879855449f57aeeb336ee3c88
  • Fix typos in comments. Etsuro Fujita http://git.postgresql.org/pg/commitdiff/017b2e9822cf6c28fc5024a5f9a6f0d3dde885a4
  • Eliminate one background-worker-related flag variable. Teach sigusr1_handler() to use the same test for whether a worker might need to be started as ServerLoop(). Aside from being perhaps a bit simpler, this prevents a potentially-unbounded delay when starting a background worker. On some platforms, select() doesn't return when interrupted by a signal, but is instead restarted, including a reset of the timeout to the originally-requested value. If signals arrive often enough, but no connection requests arrive, sigusr1_handler() will be executed repeatedly, but the body of ServerLoop() won't be reached. This change ensures that, even in that case, background workerw will eventually get launched. This is far from a perfect fix; really, we need select() to return control to ServerLoop() after an interrupt, either via the self-pipe trick or some other mechanism. But that's going to require more work and discussion, so let's do this for now to at least mitigate the damage. Per investigation of test_shm_mq failures on buildfarm member anole. http://git.postgresql.org/pg/commitdiff/d0410d66037c2f3f9bee45e0a2db9e47eeba2bb4

Peter Eisentraut a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Bogdan Pilch sent in a patch to allow trailing commas in SELECT statements.
  • Heikki Linnakangas sent in a patch to use a plain memcmp() to compare the Datums while building the red-black tree for GIN.
  • Peter Eisentraut sent in a patch to correct the documentation for effective_io_concurrency.
  • Peter Geoghegan sent in another revision of a patch to add a new infrastructure to sortsupport, and add a single client of this new infrastructure, the text sortsupport routine.
  • Herwin Weststrate sent in two revisions of a patch to allow format 0000-0000-0000 in the MAC parser.
  • Kaigai Kouhei sent in two more revisions of a patch to create a custom scan API.
  • Michael Paquier and Ali Akbar traded patches to add a generate_series(numeric, numeric) function.
  • Fabrízio de Royes Mello and Marti Raudsepp traded patches to implement CINE for indexes.
  • Michael Paquier sent in another revision of a patch to implement REINDEX CONCURRENTLY.
  • Adam Brightwell sent in three revisions of a patch to clean up superuser().
  • Ilya Kosmodemiansky sent in a patch to to trace LWLocks with the lowest possible performance impact.
  • Thomas Munro sent in two revisions of a patch to implement NEXT VALUE FOR <sequence>.
  • Kaigai Kouhei sent in a patch to insure that the new port/atomics/*.h files are included when installing.
  • Marti Raudsepp sent in a patch to allow semijoin/antijoin/hashed SubPlan optimization when an EXISTS subquery contains a LIMIT clause with a positive constant.
  • Fabrízio de Royes Mello sent in a patch to ensure that the CREATE SEQUENCE syntax correctly summarizes the options for CREATE SEQUENCE.
  • Kaigai Kouhei sent in a patch to make ResourceOwnerForgetBuffer() O(1) instead of O(N^2).
  • Michael Banck sent in a patch to allow logging to notice that a checkpoint is to be written on shutdown.
  • Heikki Linnakangas sent in another revision of a patch to create a pgbench throttling latency limit.
  • Shigeru HANADA sent in a WIP patch to add join push-down support for foreign tables.
  • Andrew Dunstan sent in a patch to implement json[b]_strip_nulls.
  • Marco Nenciarini sent in a patch to add an optional backup profile to pg_basebackup in service of the eventual feature, incremental backup.
  • Heikki Linnakangas sent in another revision of a patch to change the WAL format and API.

par N Bougain le jeudi 9 octobre 2014 à 21h55

jeudi 2 octobre 2014

Dimitri Fontaine

Meetup PostgreSQL à Paris

Mercredi 8 octobre se tiendra le prochain Meetup PostgreSQL à Paris dans les locaux de Mozilla Europe, dont la capacité est de 90 personnes ! Venez nombreux !

Le programme de cette édition est un peu particulier puisque nous avons reçu quatre propositions enthousiastes de présentations. Chacun aura donc 15 à 20 minutes (questions incluses) pour présenter son sujet. Voici le programme :

  • Aggrégation temporelle sous contrainte d'iops, par Jean-Gérard Pailloncy
  • Le partitionnement de tables démystifié, par Flavio Henrique Araque Gurgel
  • PoWA, par Thomas Reiss et Julien Rouhaud
  • PostgreSQL pour les développeurs, par Dimitri Fontaine

Nous aurons aussi le plaisir de partager un buffet sponsorisé cette fois par Novapost, un grand merci à eux.

À mercredi !

par dim@tapoueh.org (Dimitri Fontaine) le jeudi 2 octobre 2014 à 09h49

lundi 29 septembre 2014

Actualités PostgreSQL.fr

Nouvelles hebdomadaires de PostgreSQL - 28 septembre 2014

[ndt: Meetup PUG parisien le 8 octobre : http://www.meetup.com/PostgreSQL-User-Group-Paris/]

Les nouveautés des produits dérivés

Offres d'emplois autour de PostgreSQL en septembre

PostgreSQL Local

  • La cinquième édition du PgDay argentin est programmée pour le 28 novembre 2014 à Santa Fe. L'appel international à conférenciers court jusqu'au 28 septembre : http://www.postgresql.org.ar/pgday2014
  • Le 4ème PgDay équatorien aura lieu le mardi 7 octobre en la ville de Quito, intégré au 5ème congrès international du Logiciel Libre. Envoyez vos propositions de conférences à ecpug AT postgresql DOT org.
  • Le sixième PGDay cubain aura lieu les 13 et 14 octobre 2014 à la Havane : https://postgresql.uci.cu/?p=380
  • Les inscriptions pour la PGConf.EU 2014 de Madrid, Espagne, du 21 au 24 octobre sont à présent ouvertes : http://2014.pgconf.eu/registration/
  • Le PGDay.IT 2014 aura lieu à Prato le 7 novembre 2014. L'appel international à conférenciers a été lancé : http://2014.pgday.it/call-for-papers-en/

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

Andres Freund a poussé :

  • Improve code around the recently added rm_identify rmgr callback. There are four weaknesses in728f152e07f998d2cb4fe5f24ec8da2c3bda98f2: append_init() in heapdesc.c was ugly and required that rm_identify return values are only valid till the next call. Instead just add a couple more switch() cases for the INIT_PAGE cases. Now the returned value will always be valid. A couple rm_identify() callbacks missed masking xl_info with ~XLR_INFO_MASK. pg_xlogdump didn't map a NULL rm_identify to UNKNOWN or a similar string. append_init() was called when id=NULL - which should never actually happen. But it's better to be careful. http://git.postgresql.org/pg/commitdiff/604f7956b9460192222dd37bd3baea24cb669a47
  • Remove postgres --help blurb about the removed -A option. I missed this in 3bdcf6a5a755503. Noticed by Merlin Moncure. Discussion: CAHyXU0yC7uPeeVzQROwtnrOP9dxTEUPYjB0og4qUnbipMEV57w@mail.gmail.com http://git.postgresql.org/pg/commitdiff/0926ef43c160cc8334d3e86f364bf9a7aa2da43f
  • Remove most volatile qualifiers from xlog.c. For the reason outlined in df4077cda2e also remove volatile qualifiers from xlog.c. Some of these uses of volatile have been added after noticing problems back when spinlocks didn't imply compiler barriers. So they are a good test - in fact removing the volatiles breaks when done without the barriers in spinlocks present. Several uses of volatile remain where they are explicitly used to access shared memory without locks. These locations are ok with slightly out of date data, but removing the volatile might lead to the variables never being reread from memory. These uses could also be replaced by barriers, but that's a separate change of doubtful value. http://git.postgresql.org/pg/commitdiff/6ba4ecbf477e0b25dd7bde1b0c4e07fc2da19348
  • Fix VPATH builds of the replication parser from git for some !gcc compilers. Some compilers don't automatically search the current directory for included files. 9cc2c182fc2 fixed that for builds from tarballs by adding an include to the source directory. But that doesn't work when the scanner is generated in the VPATH directory. Use the same search path as the other parsers in the tree. One compiler that definitely was affected is solaris' sun cc. Backpatch to 9.1 which introduced using an actual parser for replication commands. http://git.postgresql.org/pg/commitdiff/56a312aac8802c2aa01530101d2d19e63568eeda
  • Add a basic atomic ops API abstracting away platform/architecture details. Several upcoming performance/scalability improvements require atomic operations. This new API avoids the need to splatter compiler and architecture dependent code over all the locations employing atomic ops. For several of the potential usages it'd be problematic to maintain both, a atomics using implementation and one using spinlocks or similar. In all likelihood one of the implementations would not get tested regularly under concurrency. To avoid that scenario the new API provides a automatic fallback of atomic operations to spinlocks. All properties of atomic operations are maintained. This fallback - obviously - isn't as fast as just using atomic ops, but it's not bad either. For one of the future users the atomics ontop spinlocks implementation was actually slightly faster than the old purely spinlock using implementation. That's important because it reduces the fear of regressing older platforms when improving the scalability for new ones. The API, loosely modeled after the C11 atomics support, currently provides 'atomic flags' and 32 bit unsigned integers. If the platform efficiently supports atomic 64 bit unsigned integers those are also provided. To implement atomics support for a platform/architecture/compiler for a type of atomics 32bit compare and exchange needs to be implemented. If available and more efficient native support for flags, 32 bit atomic addition, and corresponding 64 bit operations may also be provided. Additional useful atomic operations are implemented generically ontop of these. The implementation for various versions of gcc, msvc and sun studio have been tested. Additional existing stub implementations for Intel icc, HUPX acc, and IBM xlc are included but have never been tested. These will likely require fixes based on buildfarm and user feedback. As atomic operations also require barriers for some operations the existing barrier support has been moved into the atomics code. Author: Andres Freund with contributions from Oskari Saarenmaa Reviewed-By: Amit Kapila, Robert Haas, Heikki Linnakangas and Álvaro Herrera Discussion: CA+TgmoYBW+ux5-8Ja=Mcyuy8=VXAnVRHp3Kess6Pn3DMXAPAEA@mail.gmail.com, 20131015123303.GH5300@awork2.anarazel.de, 20131028205522.GI20248@awork2.anarazel.de http://git.postgresql.org/pg/commitdiff/b64d92f1a5602c55ee8b27a7ac474f03b7aee340
  • Fix atomic ops for x86 gcc compilers that don't understand atomic intrinsics. Per buildfarm animal locust. http://git.postgresql.org/pg/commitdiff/88bcdf9da5aa67da11ada0921703432ef2b7c21c
  • Fix atomic ops inline x86 inline assembly for older 32bit gccs. Some x86 32bit versions of gcc apparently generate references to the nonexistant %sil register when using when using the r input constraint, but not with the =q constraint. The latter restricts allocations to a/b/c/d which should all work. http://git.postgresql.org/pg/commitdiff/f18cad944911f05ad2e876af67362e28584b3c61
  • Define META_FREE in a way that doesn't cause -Wempty-body warnings. That get rids of the only -Wempty-body warning when compiling postgres with gcc 4.8/9. As 6550b901f shows, it's useful to be able to use that option routinely. Without asserts there's many more warnings, but that's food for another commit. http://git.postgresql.org/pg/commitdiff/9b6bb9b47153e4bf6d23bef13165491ba440fc23
  • Fix a couple occurrences of 'the the' in the new atomics API. Author: Erik Rijkers http://git.postgresql.org/pg/commitdiff/a30199b01bd4b06bd13484baefb5f2f411ce14f4
  • Further atomic ops portability improvements and bug fixes. Don't play tricks for a more efficient pg_atomic_clear_flag() in the generic gcc implementation. The old version was broken on gcc < 4.7 on !x86 platforms. Per buildfarm member chipmunk: Make usage of __atomic() fences depend on. HAVE_GCC__ATOMIC_INT32_CAS instead of HAVE_GCC__ATOMIC_INT64_CAS - there's platforms with 32bit support that don't support 64bit atomics. Blindly fix two superflous #endif in generic-xlc.h. Check for --disable-atomics in platforms but x86. http://git.postgresql.org/pg/commitdiff/f9f07411a5b879b232ade66fece7071bd2eb5c26

Robert Haas a poussé :

  • Fix mishandling of CreateEventTrigStmt's eventname field. It's a string, not a scalar. Petr Jelinek http://git.postgresql.org/pg/commitdiff/763ba1b0f2aa8353e3e3b02bc6bd965deb4575e0
  • Fix compiler warning. It is meaningless to declare a pass-by-value return type const. http://git.postgresql.org/pg/commitdiff/e38da8d6b1bd494b72a6f84310d30b55b3f67c3e
  • Remove volatile qualifiers from lwlock.c. Now that spinlocks (hopefully!) act as compiler barriers, as of commit 0709b7ee72e4bc71ad07b7120acd117265ab51d0, this should be safe. This serves as a demonstration of the new coding style, and may be optimized better on some machines as well. http://git.postgresql.org/pg/commitdiff/df4077cda2eae3eb4a5cf387da0c1e7616e73204
  • Change locking regimen around buffer replacement. Previously, we used an lwlock that was held from the time we began seeking a candidate buffer until the time when we found and pinned one, which is disastrous for concurrency. Instead, use a spinlock which is held just long enough to pop the freelist or advance the clock sweep hand, and then released. If we need to advance the clock sweep further, we reacquire the spinlock once per buffer. This represents a significant increase in atomic operations around buffer eviction, but it still wins on many workloads. On others, it may result in no gain, or even cause a regression, unless the number of buffer mapping locks is also increased. However, that seems like material for a separate commit. We may also need to consider other methods of mitigating contention on this spinlock, such as splitting it into multiple locks or jumping the clock sweep hand more than one buffer at a time, but those, too, seem like separate improvements. Patch by me, inspired by a much larger patch from Amit Kapila. Reviewed by Andres Freund. http://git.postgresql.org/pg/commitdiff/5d7962c6797c0baae9ffb3b5b9ac0aec7b598bc3
  • Fix identify_locking_dependencies for schema-only dumps. Without this fix, parallel restore of a schema-only dump can deadlock, because when the dump is schema-only, the dependency will still be pointing at the TABLE item rather than the TABLE DATA item. Robert Haas and Tom Lane http://git.postgresql.org/pg/commitdiff/07d46a8963ebbf69ef6e6853bb8a45623612dd34

Stephen Frost a poussé :

  • Process withCheckOption exprs in setrefs.c. While withCheckOption exprs had been handled in many cases by happenstance, they need to be handled during set_plan_references and more specifically down in set_plan_refs for ModifyTable plan nodes. This is to ensure that the opfuncid's are set for operators referenced in the withCheckOption exprs. Identified as an issue by Thom Brown Patch by Dean Rasheed Back-patch to 9.4, where withCheckOption was introduced. http://git.postgresql.org/pg/commitdiff/6ef8c658af2127f4e62cb24feade8b465c9e2fea
  • Log ALTER SYSTEM statements as DDL. Per discussion in bug #11350, log ALTER SYSTEM commands at the log_statement=ddl level, rather than at the log_statement=all level. Pointed out by Tomonari Katsumata. Back-patch to 9.4 where ALTER SYSTEM was introduced. http://git.postgresql.org/pg/commitdiff/43bed84c320443ee7247f7ca8d609640651aab93
  • Add unicode_*_linestyle to \? variables. In a2dabf0 we added the ability to have single or double unicode linestyle for the border, column, or header. Unfortunately, the \? variables output was not updated for these new psql variables. This corrects that oversight. Patch by Pavel Stehule. http://git.postgresql.org/pg/commitdiff/a564307373089fc81a07bce49236fe2bd66de0fe
  • Copy-editing of row security. Address a few typos in the row security update, pointed out off-list by Adam Brightwell. Also include 'ALL' in the list of commands supported, for completeness. http://git.postgresql.org/pg/commitdiff/afd1d95f5bf0cb48af77e5897eb4c356b5371c7b
  • Code review for row security. Buildfarm member tick identified an issue where the policies in the relcache for a relation were were being replaced underneath a running query, leading to segfaults while processing the policies to be added to a query. Similar to how TupleDesc RuleLocks are handled, add in a equalRSDesc() function to check if the policies have actually changed and, if not, swap back the rsdesc field (using the original instead of the temporairly built one; the whole structure is swapped and then specific fields swapped back). This now passes a CLOBBER_CACHE_ALWAYS for me and should resolve the buildfarm error. In addition to addressing this, add a new chapter in Data Definition under Privileges which explains row security and provides examples of its usage, change \d to always list policies (even if row security is disabled- but note that it is disabled, or enabled with no policies), rework check_role_for_policy (it really didn't need the entire policy, but it did need to be using has_privs_of_role()), and change the field in pg_class to relrowsecurity from relhasrowsecurity, based on Heikki's suggestion. Also from Heikki, only issue SET ROW_SECURITY in pg_restore when talking to a 9.5+ server, list Bypass RLS in \du, and document --enable-row-security options for pg_dump and pg_restore. Lastly, fix a number of minor whitespace and typo issues from Heikki, Dimitri, add a missing #include, per Peter E, fix a few minor variable-assigned-but-not-used and resource leak issues from Coverity and add tab completion for role attribute bypassrls as well. http://git.postgresql.org/pg/commitdiff/6550b901fe7c47c03775400e0c790c6c1234a017
  • Fix relcache for policies, and doc updates. Andres pointed out that there was an extra ';' in equalPolicies, which made me realize that my prior testing with CLOBBER_CACHE_ALWAYS was insufficient (it didn't always catch the issue, just most of the time). Thanks to that, a different issue was discovered, specifically in equalRSDescs. This change corrects eqaulRSDescs to return 'true' once all policies have been confirmed logically identical. After stepping through both functions to ensure correct behavior, I ran this for about 12 hours of CLOBBER_CACHE_ALWAYS runs of the regression tests with no failures. In addition, correct a few typos in the documentation which were pointed out by Thom Brown (thanks!) and improve the policy documentation further by adding a flushed out usage example based on a unix passwd file. Lastly, clean up a few comments in the regression tests and pg_dump.h. http://git.postgresql.org/pg/commitdiff/ff27fcfa0affe16405e801ed55fed10e7bc75216

Tom Lane a poussé :

  • Fix incorrect search for "x?" style matches in creviterdissect(). When the number of allowed iterations is limited (either a "?" quantifier or a bound expression), the last sub-match has to reach to the end of the target string. The previous coding here first tried the shortest possible match (one character, usually) and then gave up and back-tracked if that didn't work, typically leading to failure to match overall, as shown in bug #11478 from Christoph Berg. The minimum change to fix that would be to not decrement k before "goto backtrack"; but that would be a pretty stupid solution, because we'd laboriously try each possible sub-match length before finally discovering that only ending at the end can work. Instead, force the sub-match endpoint limit up to the end for even the first shortest() call if we cannot have any more sub-matches after this one. Bug introduced in my rewrite that added the iterdissect logic, commit 173e29aa5deefd9e71c183583ba37805c8102a72. The shortest-first search code was too closely modeled on the longest-first code, which hasn't got this issue since it tries a match reaching to the end to start with anyway. Back-patch to all affected branches. http://git.postgresql.org/pg/commitdiff/3694b4d7e1aa02f917f9d18c550fbb49b96efa83
  • Fix bogus variable-mangling in security_barrier_replace_vars(). This function created new Vars with varno different from varnoold, which is a condition that should never prevail before setrefs.c does the final variable-renumbering pass. The created Vars could not be seen as equal() to normal Vars, which among other things broke equivalence-class processing for them. The consequences of this were indeed visible in the regression tests, in the form of failure to propagate constants as one would expect. I stumbled across it while poking at bug #11457 --- after intentionally disabling join equivalence processing, the security-barrier regression tests started falling over with fun errors like "could not find pathkey item to sort", because of failure to match the corrupted Vars to normal ones. http://git.postgresql.org/pg/commitdiff/3f6f9260e308a331e6809d5309b17d1613ff900f

Andrew Dunstan a poussé :

Heikki Linnakangas a poussé :

  • Add -D option to specify data directory to pg_controldata and pg_resetxlog. It was confusing that to other commands, like initdb and postgres, you would pass the data directory with "-D datadir", but pg_controldata and pg_resetxlog would take just plain path, without the "-D". With this patch, pg_controldata and pg_resetxlog also accept "-D datadir". Abhijit Menon-Sen, with minor kibitzing by me http://git.postgresql.org/pg/commitdiff/b0d81adea650a4bc2b9391234345bb935b89a694
  • Refactor space allocation for base64 encoding/decoding in pgcrypto. Instead of trying to accurately calculate the space needed, use a StringInfo that's enlarged as needed. This is just moving things around currently - the old code was not wrong - but this is in preparation for a patch that adds support for extra armor headers, and would make the space calculation more complicated. Marko Tiikkaja http://git.postgresql.org/pg/commitdiff/1dcfb8da09c47d2a7502d1dfab06c8be4b6cf323

Peter Eisentraut a poussé :

Correctifs rejetés (à ce jour)

  • No one was disappointed this week

Correctifs en attente

  • Antonin Houska sent in a patch to fix an issue with from_collapse_limit.
  • Pavan Deolasee sent in a patch to fix an assertion failure in synchronous replication.
  • Rahila Syed sent in another revision of a patch to compress full-page writes.
  • Michael Paquier sent in a patch to remove code duplication in walsender.c and syncrep.c in order to detect what is the node with the lowest strictly-positive priority, facilitating maintenance of this code.
  • Andrew Dunstan sent in a patch to add some missing JSONB conversion functions.
  • Rajeev Rastogi sent in another revision of a patch to implement an index scan optimization.
  • Alvaro Herrera sent in two more revisions of a patch to implement BRIN indexes.
  • Robert Haas and Ants Aasma traded patches to help scale buffer eviction.
  • Peter Geoghegan sent in two more revisions of a patch to add INSERT ... ON CONFLICT {UPDATE | IGNORE}.
  • Robert Haas sent in another revision of a patch to add the modulo (%) operator to pgbench.
  • Abhijit Menon-Sen sent in a patch to fix an issue with END_OF_RECOVERY shutdowns and ResetUnloggedRelations().
  • Alvaro Herrera and Michael Paquier traded patches to enable event triggers to fire on CREATE.
  • Dilip Kumar sent in another revision of a patch to allow parallel cores to be used by vacuumdb.
  • Tom Lane sent in another revision of a patch to fix the poor TOAST compression for JSONB.
  • Andrew Dunstan sent in a patch to add JSONB generator functions.
  • Robert Haas sent in another revision of a patch to implement a pg_background contrib extension, which runs commands in a background worker, and gets the results.
  • Andrew (RhodiumToad) Gierth sent in another revision of a patch to implement GROUPING SETS.
  • Andres Freund and Heikki Linnakangas traded patches to fix an issue where it was impossible to escape from a blocked send().
  • Emre Hasegeli sent in another revision of a patch to implement selectivity estimation for inet operators.
  • Stephen Frost sent in a patch to fix an infelicity between WITH CHECK OPTION for views and column-level privileges.
  • Marko (johto) Tiikkaja sent in another revision of a patch to implement PGP armor headers in the contrib/pgcrypto extension.
  • Jeff Janes sent in a patch to fix dynahash logging.
  • Michael Paquier and Fabrízio de Royes Mello traded patches to add missing newlines in verbose logs of pg_dump, introduced by RLS patch.
  • Bogdan Pilch sent in a patch to allow toggling tab completion in psql.
  • Simon Riggs sent in another revision of a patch to allow disabling the HOT optimization.
  • Platon Malugin sent in a patch to add generate_series(numeric, numeric).
  • Bogdan Pilch sent in a patch to make psql's time output format more readable.

par N Bougain le lundi 29 septembre 2014 à 21h52

lundi 22 septembre 2014

Nicolas Thauvin

Confiner PostgreSQL avec SELinux

J'avais déjà expérimenté un peu avec SELinux il y a deux ans sans aller trop loin, parce que j'entendais souvent la phrase "Si on veut de la sécurité, il faut SELinux" et surtout à cause de l'arrivée de l'extension sepgsql dans les modules contrib de PostgreSQL. Ça avait donné une conf pour le Fosdem où finalement, j'ai plus parlé des privilèges classiques que de SELinux.

Suite à une demande au ${BOULOT}, je me suis replongé dedans, et les choses ont peu évolué. Dans la majorité des recherches que j'ai pu faire, SELinux reste tout de même un truc qui se met en travers la route, c'est-à-dire, qu'il y a toujours plus de résultats sur comment le désactiver plutôt que configurer les choses correctement. Ensuite, certains proposent de faire aveuglement confiance à setroubleshoot et audit2allow pour faire taire la bête. Enfin, j'ai dû trouver une page ou deux après en deux semaines à temps plein sur le sujet qui parlent de comment confiner un utilisateur dans le but d'implémenter ce que promet SELinux et que toutes les entreprises demandent : le RBAC, Role Based Access Control, ou comment donner le moins de droits possibles aux sous-traitants qui hébergent les serveurs.

Cette fois ci, je suis allé plus loin. Déjà, je suis parti sur une installation de CentOS 6, la famille de distribution RHEL/CentOS/Fedora semble être la plus en avance par rapport à SELinux : à peu près tous les services/daemons fournis dans l'install sont confinés par SELinux. Les utilisateurs ne le sont pas au login, il n'y a donc aucune configuration de RBAC. On verra peut-être ça plus tard, j'ai pas encore obtenu de résultat satisfaisant sur ce sujet, et il vaut mieux expliquer comment confiner correctement PostgreSQL avant de passer aux roles. Tout simplement, parce qu'il est très simple de casser ce confinement avec la configuration par défaut de RHEL, grâce à pg_ctl. Enfin, l'installation des paquets du PGDG n'est pas confinée par défaut, il manque les file contexts adaptés aux chemins particuliers de ces paquets, prévu pour faire cohabiter plusieurs versions majeures ; ce qui ne correspond pas ce qu'à prévu Red Hat pour PostgreSQL.

Après cette longue introduction, mais avant de commencer, il faut savoir administrer un minumum SELinux : si vous ne savez pas qu'il existe des options -Z, ce que sont les contexts, les types et les domaines, mieux vaut d'abord se documenter, par exemple chez Red Hat.

Voici donc les file contexts à ajouter dans un fichier module.te pour confiner l'installation PostgreSQL du PGDG :

/etc/rc\.d/init\.d/(se)?postgresql(-.*)?    --  gen_context(system_u:object_r:postgresql_initrc_exec_t,s0)
/usr/pgsql-[0-9]+\.[0-9]+/bin/initdb        --  gen_context(system_u:object_r:postgresql_exec_t,s0)
/usr/pgsql-[0-9]+\.[0-9]+/bin/pg_ctl        --  gen_context(system_u:object_r:postgresql_initrc_exec_t,s0)
/usr/pgsql-[0-9]+\.[0-9]+/bin/postgres      --  gen_context(system_u:object_r:postgresql_exec_t,s0)
/usr/pgsql-[0-9]+.[0-9]+/share/locale(/.*)?     gen_context(system_u:object_r:locale_t,s0)
/usr/pgsql-[0-9]+.[0-9]+/share/man(/.*)?        gen_context(system_u:object_r:man_t,s0)

Tout d'abord, pour l'init script et pg_ctl, on utilise le type postgresql_initrc_exec_t, c'est ce qui permet de lancer PostgreSQL dans le domaine confiné postgresql_t au boot, via l'init script, et manuellement. La méthode la plus propre est de toujours utiliser l'init script, idéalement par l'intermédiaire de run_init pour démarrer, arrêter ou redémarrer le postmaster. On évite alors de laisser trainer des choses dans /var/{run,lock}.

Les programmes postgres et initdb doivent avoir le type postgresql_exec_t car ils exécutent le serveur PostgreSQL ; cela doit se faire dans le domaine postgresql_t.

Enfin, on a placé les labels corrects sur les fichiers de traduction et les pages de man, pour faire plus propre. Ce code source de module SELinux alors doit être compilé et chargé.

Cette configuration est reprise dans le module SELinux disponible sur github. On peut aussi l'ajouter manuellement avec semanage :

semanage fcontext -a -t postgresql_initrc_exec_t '/etc/rc\.d/init\.d/(se)?postgresql(-.*)?'
semanage fcontext -a -t postgresql_exec_t '/usr/pgsql-[0-9]+\.[0-9]+/bin/initdb'
semanage fcontext -a -t postgresql_initrc_exec_t '/usr/pgsql-[0-9]+\.[0-9]+/bin/pg_ctl'
semanage fcontext -a -t postgresql_exec_t '/usr/pgsql-[0-9]+\.[0-9]+/bin/postgres'
semanage fcontext -a -t locale_t '/usr/pgsql-[0-9]+.[0-9]+/share/locale(/.*)?'
semanage fcontext -a -t man_t '/usr/pgsql-[0-9]+.[0-9]+/share/man(/.*)?'

Il existe un certain nombre de booleans pour la configuration des droits SELinux de PostgreSQL, le plus important concerne rsync, souvent nécessaire pour faire des base backups. Il s'agit de postgresql_can_rsync, pour l'activer :

semanage boolean -m --on postgresql_can_rsync

Si on lance l'instance sur un port TCP différent de 5432, il faut l'autoriser dans la configuration locale de SELinux :

semanage port -a -t postgresql_port_t -p tcp <port>

Enfin, il ne faut pas oublier d'appliquer les contexts aux fichiers soit avec restorecon, un relabel complet au reboot ou chcon.

lundi 22 septembre 2014 à 14h23

Rodolphe Quiédeville

Django Paginator oui mais

Après la lecture de l'excellent article de Markus Winnand no-offset j'ai réalisé un test pour mesurer la différence de performance de l'utilisation d'OFFSET avec Django.

La suite à lire sur le blog Novapost's paradize.

par Rodolphe Quiédeville le lundi 22 septembre 2014 à 08h13

mercredi 10 septembre 2014

Dimitri Fontaine

PHP Tour, La Video

En juin dernier se tenait le PHP Tour 2014 à Lyon, où j'ai eu le plaisir de présenter une conférence sur PostgreSQL en 2014.

Cette intervention était filmée, et la vidéo est maintenant disponible :

En espérant que vous regarderez cette vidéo avec autant d'intérêt que j'ai eu à participer à PHP Tour 2014 !

par dim@tapoueh.org (Dimitri Fontaine) le mercredi 10 septembre 2014 à 09h59

lundi 16 juin 2014

Nicolas Thauvin

pgbench et .pgpass

En faisant quelques tests sur le Foreign Data Wrapper, j'ai (re)fait un peu de pgbench. Pour ceux qui ne savent pas pgbench permet de simuler un benchmark TPC-B, en gros des lectures, des écritures par un certain nombre de sessions concurrentes.

Même si on peut le considérer simpliste par rapport à un Tsung, il est fourni dans les contribs de PostgreSQL et permet de facilement tester un aspect qu'on néglige souvent : les effets de la concurrence sur une base.

J'ai donc monté mon petit environnement de test avec un rôle pour pgbench et sa base dédiée. Pour aller plus vite, j'en ai profité pour configurer un fichier .pgpass, sauf que pgbench n'en voulait pas :

postgres@fdw:~$ cat .pgpass 
localhost:5432:*:bench:Clair!

postgres@fdw:~$ pgbench -h localhost -n -c 10 -j 10 -U bench bench
Password: 
Connection to database "bench" failed:
fe_sendauth: no password supplied

Poutant, la ligne pour l'utilisateur bench est correcte. Si on lui fournit explicitement le port 5432, il tient compte de l'entrée dans le .pgpass :

postgres@fdw:~$ pgbench -h localhost -n -c 10 -j 10 -U bench -p 5432 bench
transaction type: TPC-B (sort of)
scaling factor: 500
query mode: simple
number of clients: 10
number of threads: 10
number of transactions per client: 10
number of transactions actually processed: 100/100
tps = 77.993447 (including connections establishing)
tps = 88.977249 (excluding connections establishing)

La lecture de ce thread, qui se conclut sur ce patch, nous éclaire sur ce comportement.

Selon le message de commit, la modification change le comportement de la libpq. Elle n'a pas été backportée sur les autres branches et ne sera donc disponible que pour la libpq de la version 9.4 (ou Debian/Ubuntu qui prend toujours la dernière version de la libpq).

lundi 16 juin 2014 à 10h51

samedi 12 avril 2014

Guillaume Lelarge

Nouvelle série d'articles pour GLMF

Après l'article sur les nouveautés de la version 9.3, j'ai entamé une série d'articles sur le fonctionnement du planificateur (aussi appelé optimiseur).

Le premier est sorti ce mois-ci, dans le numéro 170 de GNU/Linux Magazine France. Il traite des différents types de parcours que l'optimiseur peut planifier.

J'ai loupé le coche pour le prochain numéro, donc celui sur les jointures devrait sortir dans le numéro 172 si tout va bien. En fait, je viens tout juste de finir son écriture.

Il y aura certainement deux autres articles, un sur les autres types de nœuds et un sur les outils pour la compréhension des plans d'exécution mais ils restent à écrire.

En attendant, je suis preneur de toute remarque/critique sur mes articles :)

par Guillaume Lelarge le samedi 12 avril 2014 à 16h11

mardi 11 mars 2014

Rodolphe Quiédeville

Debian, PG9.3, Osmosis et Nominatim

Même en se basant sur des références en terme de stabilité il peut arriver que certains combos soient fatals à votre production. C'est ce qui m'est arrivé récemment pour un serveur Nominatim installé pourtant sur une Debian Wheezy, osmosis est utilisé pour la mise à jour continue de la base Nominatim et m'a fait des misères que je m'en vais vous conter.

En parallèle de la version de PostgreSQL 9.1 standard Debian j'ai installé sur la machine une 9.3 en provenance du dépôt Debian de la communauté PG (le support dfe JSON dans PG 9.3 c'est awesome), jusque là tout va bien. Seulement à l'upgrade suivant le paquet libpostgis-java est passé en version 2.1.1-5.pgdg70+1 (celle-ci étant disponible sur le dépôt PG) ; malheureusement cette version est incompatible avec osmosis packagé chez Debian qui nécessite la version 1.5.3 de cette librairie, et là c'est le drâme !

Donc si au lancement d'osmosis vous rencontrez l'erreur :

java.io.FileNotFoundException: /usr/share/java/postgis.jar

Alors que le sus-dit fichier est bien présent, et que vous commencez à dire du mal des backtraces java, il existe un solution simple et efficace, downgrader la version de libpostgis-java en quelques commandes :

dpkg --remove osmosis
apt-get install libpostgis-java=1.5.3-2 osmosis

Sans oublier un pinning pour éviter la future mise à jour du paquet.

par Rodolphe Quiédeville le mardi 11 mars 2014 à 08h07

dimanche 2 mars 2014

Guillaume Lelarge

Deux news... (GLMF + traduction)

Ça fait un bon moment que je n'ai pas publié un billet sur ce blog... ça fait peur :)

Bref, deux nouvelles intéressantes.

J'ai mis à jour les manuels français suite aux dernières versions mineures. Ça n'a pas été spécialement long de le faire. Par contre, il n'a pas été simple de trouver le temps pour le faire. Mais bon, c'est fait, les manuels sont à jour.

Il y avait aussi longtemps que je n'avais pas écrit un article pour le GNU/Linux Magazine France. J'ai enfin repris, avec un article sur les nouveautés de la version 9.3. Il est paru sur le GLMF 169. Je pense qu'il y aura d'autres articles, suivant le temps à ma disposition et la motivation que j'ai. Pour l'instant, j'essaie d'écrire sur le planificateur de requêtes, sujet que j'étudie depuis plus d'un an maintenant. Cela étant dit, si vous avez des idées de sujets, je suis preneur :)

par Guillaume Lelarge le dimanche 2 mars 2014 à 21h54

dimanche 22 septembre 2013

Guillaume Lelarge

Manuels de PostgreSQL en PDF

J'ai fini par m'y remettre. Depuis que je suis passé d'Ubuntu à Fedora, je ne pouvais plus générer le manuel de PostgreSQL au format PDF. Cet après-midi, n'arrivant pas à me mettre à autre chose, je me suis collé à ça.

Pour réussir à générer, j'ai récupéré la dernière version de docbook-xsl (1.78.1), puis j'ai modifié le fichier /opt/docbook-xsl/profiling/profile-mode.xsl pour mettre en commentaire la ligne 214. Ensuite, j'ai modifié le fichier stylesheets/pg-profile.xsl des sources de la documentation pour remplacer l'appel à /opt/docbook-xsl/profiling/profile-mode-pdf.xsl par un appel à /opt/docbook-xsl/profiling/profile-mode.xsl. Enfin, j'ai exporté deux variables :

export PATH=/home/guillaume/bin/fop-0.20.5:$PATH
export JAVA_HOME=/usr

Et, pas de soucis pour générer le PDF des versions 8.4 et 9.0. La 9.1 continue à me donner du fil à retordre mais rien de bien méchant. C'est simplement (très) long car il faut tester la génération, parfois plusieurs fois, pour trouver et comprendre chaque problème rencontré.

Mais bon, ça va venir. Ce n'est plus qu'une question de jours...

par Guillaume Lelarge le dimanche 22 septembre 2013 à 21h57

mardi 2 juillet 2013

Guillaume Lelarge

Plus que 20 jours pour proposer une conférence à pgconf.eu 2013

L'appel à conférencier est disponible depuis un moment. Du coup, il ne reste plus que 20 jours pour proposer une conférence à pgconf.eu 2013. Cela étant dit, ne désespérez pas, il vous reste un peu de temps :)

Ne pensez pas que vous n'avez rien d'intéressant à raconter. Votre expérience, vos compétences, vos outils sont autant de sujets passionnants de conférences.

Bref, n'hésitez pas à proposer une conférence. Et de toute façon, venez participer à cet événement. Les conférences, les tutoriels, les rencontres avec les contributeurs sont des raisons amplement suffisantes pour venir à Dublin.

par Guillaume Lelarge le mardi 2 juillet 2013 à 21h08

mercredi 26 juin 2013

Sébastien Lardière

Suivi de l'activité dans PostgreSQL 9.2

Jumelles

La vue pg_stat_activity a évolué dans la version 9.2 de PostgreSQL, ajoutant des informations essentielles, et modifiant des éléments déjà existant. Afin de l'exploiter au mieux, j'ai ajouté une vue dans certaines instances de production, simplifiant son usage.

Une première différence notable, qui peut-être déroutante lorsqu'on ne la connaît pas, est la séparation dans l'ancien attribut query_string en deux attributs : state et query ; auparavant, l'état d'une session se lisait en fonction de la valeur de query_string, et si la valeur était une requête SQL, c'est que la session était active. Désormais,... Lire Suivi de l'activité dans PostgreSQL 9.2

par Sébastien Lardière le mercredi 26 juin 2013 à 12h10

lundi 24 juin 2013

Guillaume Lelarge

Petit compte-rendu sur le pgday.fr 2013

L'association PostgreSQL.fr a organisé un pgday à Nantes cette année. Il a eu lieu le 13 juin et a réuni plus d'une centaine de participants. Il s'agit à ma connaissance du plus gros événement PostgreSQL sur une journée en France à ce jour. Félicitations aux organisateurs. Sans compter que l'organisation a été sans faille : enregistrement simple, bon traiteur (sans que ce soit aussi génial que Ivanne et Sidonie, les traiteurs des PostgreSQL Sessions et du pgday.fr 2009), salle assez grande mais pas trop, une soirée sympa... vraiment bien.

Au niveau des conférences, il y avait aussi du très bon. Cédric Villemain a parlé de la gestion des ressources mémoires, Damien Clochard des nouveautés de la version 9.3, Philippe Beaudoin de simulation de charge, Hugo Mercier de PostGIS 2.0, Grégoire Hubert de POMM, Gilles Darold d'ora2pg, Dimitri Fontaine de grosses volumétries avec PostgreSQL, moi-même des plans d'exécution et de la commande EXPLAIN, et Vik Fearing de la clause LATERAL. Une journée donc très chargée et bourrée d'informations. Sans parler des discussions entre les conférences, qui sont souvent un moment particulier pour apprendre, découvrir et s'enthousiasmer.

Pour moi, la meilleure conférence était celle de Philippe Beaudoin. Il a une manière très agréable et assez unique de présenter une étude de cas. Il a donc montré comment il a cherché (et réussi) à simuler une charge au niveau de la base de données pour s'assurer que son projet était viable. Sans aller dans les détails, il a quand même indiqué les outils qu'il a utilisé, quelques requêtes et ses résultats. Ce n'était pas vraiment technique, pas seulement une étude de cas... ce qui fait que tout le monde a pu trouver quelque chose à récupérer de sa conférence. Très impressionnant. En tout cas, ça m'a donné des idées pour de nouveaux rapports d'activité dans pgbadger.

Autre conférence intéressante, celle de Grégoire Hubert sur POMM. En fait, c'est plutôt le conférencier qui était intéressant. Il sait très bien faire passer son message. Ça fait très showman mais c'est très efficace et ça a permis de tenir éveiller les participants lors du créneau particulièrement difficile qui suit le repas :)

Quant à ma propre conférence, elle s'est plutôt bien passée. J'ai du aller vite car il y avait beaucoup de contenu pour seulement 50 minutes. J'espère n'avoir perdu personne. Les retours sont bons dans l'ensemble et ça fait plaisir. Les slides sont disponibles sur le site du pgday.fr ainsi que sur le site dalibo.org.

Pour terminer sur ce compte-rendu, je dois avouer que j'ai été agréablement surpris et que j'espère pouvoir être présent l'année prochaine pour l'édition 2014.

Et pour les intéressés, mes photos des conférenciers et des organisateurs.

par Guillaume Lelarge le lundi 24 juin 2013 à 20h09

lundi 20 mai 2013

Guillaume Lelarge

Traduction de la documentation de PostgreSQL 9.3

Contrairement à l'année dernière, le merge a été beaucoup plus rapide. En moins de trois jours, il était terminé. Il est donc possible de commencer la traduction.

Ceux qui veulent participer sont les bienvenus. La liste des fichiers et les instructions sont disponibles sur : https://github.com/gleu/pgdocs_fr/wiki/translation-9.3. Il est possible que j'ai besoin de donner le droit de modifier cette page, on verra bien. J'avoue que je ne connais pas bien le système wiki de github.

De mon côté, je vais commencer certainement dès demain.

Pour ceux qui ont besoin de cette documentation, elle est disponible sur http://docs.postgresql.fr/9.3/. Elle sera mise à jour au fur et à mesure de l'avancement de la traduction (donc, là, c'est juste la documentation de la 9.2 en français, dans laquelle se trouvent greffés les ajouts de la 9.3 en anglais).

par Guillaume Lelarge le lundi 20 mai 2013 à 17h01

lundi 13 mai 2013

ulhume

EXT3/4 et performances

Il y a quelques mois, je me suis retrouvé confronté à un postreSQL complètement poussif sur une machine pourtant performante et fraichement installée. Alors PostgreSQL fautif ? Pas du tout car le même problème s&aposest reproduit sur une autre machine, mais cette fois tournant avec MySQL. La source du problème : EXT4.

EDIT: Ajout du chapitre "et maintenant, EXT3 aussi..."

EXT4 et la barrière d&aposécriture

En fait le problème apparaît uniquement en écriture. À haut débit, celles-ci peuvent être jusqu&aposà 30% plus lentes qu&aposavec un disque formaté sous EXT3. Les répercutions se font donc sentir sur tout système amené à écrire à haute fréquence, bases de données en tête évidemment.

La raison tient en un système ajouté pour garantir l&aposintégrité des caches lors des écritures. EXT4 va en effet émettre un "write barrier" (barrière d&aposécriture) à chaque synchronisation des caches (fsync). De la sorte, si un crash complet du système survient (ou si quelqu&aposun se prend les pieds dans les prises du rack de serveurs), EX4 garanti que je journal est parfaitement à jour. Tout ceci est très bien pour un serveur critique, c&aposest un peu moins pertinent pour une machine utilisée comme serveur web ou une machine de développement.

La "solution" consiste donc à désactiver la levée des barrières, ce qui se fait à chaud par

$sudo mount /dev/sdaX -o remount,nobarrier
levée des barrières d&aposécriture sur EXT4

Et maintenant Ext3 aussi...

Après mise à jour de ma machine de développement qui utilise EXT3 sous Debian Wheezy, j&aposai découvert au détours d&aposun mount l&aposapparition d&aposun barrier=1. Il semble que la fonctionnalité "barrier" d&aposEXT4 ait donc été backportée sous EXT3. Supposition confirmée par les calamiteuses performances de Wheezy/PostgreSQL 9.1/EXT4.

Pour "corriger" cela, même motif, même punition que pour EXT4, le nobarrier fonctionne strictement de la même manière et apporte la même "solution".

Conclusion

On est bien d&aposaccord que la chose n&aposest pas à faire sur une machine où l&aposatomicité des écritures est critique. Mais dans tous les autres cas, c&aposest un gain de 30% en écriture, ce qui m&aposa un peu sauvé la vie lors d&aposune énorme migration d&aposun PHPBB de 12 ans d&aposage sous Drupal :).

lundi 13 mai 2013 à 10h19

mercredi 8 mai 2013

Guillaume Lelarge

Nouvelles versions mineures de la documentation

Désolé, encore une fois, j'ai mis du temps avant de me coller à la mise à jour de la traduction des manuels. C'est fait, c'est disponible, pour les version 8.4 à 9.2.

La version beta de la 9.3 devrait sortir demain. Je m'y colle dès demain soir. Ça risque d'être épique, comme à chaque mise à jour majeure :) Quoique, après avoir regardé le diff, ça ne semble pas si dur que ça. Sont principalement touchées la documentation sur les fonctions, la configuration, les catalogues (rien que de l'habituel jusqu'ici), ainsi que les triggers sur événement, les vues matérialisées, les Foreign Data Wrapper, pg_xlogdump, pg_isready et les Background Workers (les grosses nouveautés de cette version). N'empêche qu'il y a du boulot.

par Guillaume Lelarge le mercredi 8 mai 2013 à 14h57

mercredi 3 avril 2013

Christophe Chauvet

Utiliser le dépôt Debian/Ubuntu de PostgreSQL.org

Le projet PostgreSQL possède depuis peu son propre dépôt APT pour les différentes versions des serveurs encore maintenu et PgAdmin3, sur les versions de Debian et Ubuntu suivantes

  • Debian
    • Etch
    • Lenny
    • Squeeze
    • Wheezy
    • Sid
  • Ubuntu
    • Precise (12.04)

Si vous utilisiez déjà le dépôt squeeze backports par exemple, vous pouvez basculer facilement vers ce nouveau dépôt sans problème

Clé de signature des paquets

Avant d'installer une version de PostgreSQL, il faut ajouter la clé d'authentification des paquets dans notre trousseau de clé.

wget -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -

source.list

Il faut ensuite ajouter le dépôt au source.list, pour cela créer le fichier /etc/apt/sources.list.d/pgdg.list et ajouter les lignes suivantes (l'exemple ci-dessous est pour la version squeeze).

deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg main

Remplacer Squeeze par le nom de votre distribution.

Préférences

Pour indiquer à votre distribution de prendre et mettre à jour votre ou vos PostgreSQL à partir de cette source, il faut rajouter une configuration dite de pinning

Créer le fichier /etc/apt/preferences.d/pgdg.pref et ajouter les lignes suivantes

Package: *
Pin: release o=apt.postgresql.org
Pin-Priority: 500

Initialisation

Une fois la configuration, il faut faire un update pour mettre a jour votre gestionnaire de paquet avec ce nouveau dépôt, et charger le trousseau de clé

apt-get update
apt-get install pgdg-keyring

Ensuite il en reste plus qu'a installer la version de PostgreSQL que vous souhaitez.

apt-get install postgresql-9.2 postgresql-client-9.2 postgresql-contrib-9.2 postgresql-plpython-9.2 postgresql-server-dev-9.2 libpq-dev

par Christophe Chauvet le mercredi 3 avril 2013 à 06h05