== PostgreSQL Weekly News - September 20 2015 == == PostgreSQL Product News ==
Envelopt 1.0.0, a web platform for creating PostgreSQL applications, released. http://envelope.xyz/ PostgreDAC 4.6, a Delphi/C++ builder for PostgreSQL, and dbExpress PostgreSQL driver 3.7, released. https://www.devart.com/pgdac/ tds_fdw 1.0.4, a foreign data wrapper for MS-SQL Server and Sybase, released. https://github.com/GeoffMontee/tds_fdw/releases == PostgreSQL Jobs for September == http://archives.postgresql.org/pgsql-jobs/2015-09/ == PostgreSQL Local == PostgreSQL Session #7, will be held September 24th, 2015 in Paris, France, http://www.postgresql-sessions.org/7/about PGDay.IT 2015 will take place in Prato on October 23, 2015. http://pgday.it PostgreSQL Conference Europe 2015 will be held on October 27-30 in the Vienna Marriott Hotel, in Vienna, Austria. The schedule is posted. http://2015.pgconf.eu/ PGConf Silicon Valley 2015 is November 17-18 at the South San Francisco Convention Center. http://www.pgconfsv.com PgCUBA will take place October 19-23, 2015 in Havana. Spanish language information below: http://www.postgresql.org/about/event/1813/ PGBR2015 (The Brazilian PostgreSQL Conference) will take place in Porto Alegre, Rio Grande do Sul, on November 18, 19 and 20. The CfP is open until August 31. http://pgbr.postgresql.org.br/2015/en/#call-for-papers PGConf.DE will be held on November 26-27, 2015 in Hamburg, Germany, at the Lindner Hotel am Michel. http://2015.pgconf.de/ == PostgreSQL in the News == Planet PostgreSQL: http://planet.postgresql.org/ PostgreSQL Weekly News is brought to you this week by David Fetter Submit news and announcements by Sunday at 3:00pm Pacific time. Please send English language ones to da...@fetter.org, German language to p...@pgug.de, Italian language to p...@itpug.org. Spanish language to p...@arpug.com.ar. == Applied Patches == Teodor Sigaev pushed: - Check existency of table/schema for -t/-n option (pg_dump/pg_restore). Patch provides command line option --strict-names which requires that at least one table/schema should present for each -t/-n option. Pavel Stehule <pavel.steh...@gmail.com> http://git.postgresql.org/pg/commitdiff/d02426029b133ee2bbe492a038642359bce3c527 - Fix wrong comment in commit d02426029b133ee2bbe492a038642359bce3c527 Per gripe from Robert Haas http://git.postgresql.org/pg/commitdiff/0f75928516a55ba69d46328ec5e676c13d163831 - pgbench progress with timestamp. This patch adds an option to replace the "time since pgbench run started" with a Unix epoch timestamp in the progress report so that, for instance, it is easier to compare timelines with pgsql log Fabien COELHO <coe...@cri.ensmp.fr> http://git.postgresql.org/pg/commitdiff/1def9063ca3c8ad66a2814a90af95ca22636bf66 - Fix bug introduced by microvacuum for GiST Commit 013ebc0a7b7ea9c1b1ab7a3d4dd75ea121ea8ba7 introduces microvacuum for GiST, deletetion of tuple marked LP_DEAD uses IndexPageMultiDelete while recovery code uses IndexPageTupleDelete in loop. This causes a difference in offset numbers of tuples to delete. Patch introduces usage of IndexPageMultiDelete in GiST except gistplacetopage() where only one tuple is deleted at once. That also slightly improve performance, because IndexPageMultiDelete is more effective. Patch changes WAL format, so bump wal page magic. Bug report from Jeff Janes Diagnostic and patch by Anastasia Lubennikova and me http://git.postgresql.org/pg/commitdiff/22f519c92a45eb017bf2e65f36506a75309f8094 - Add header forgotten in 213335c14529a8d5e2007ec0c256f4cf64d62d3b. Report from Peter Eisentraut http://git.postgresql.org/pg/commitdiff/d63a1720fa0b2ca8452c3a2aa2f6ddbb4f05b640 - Fix oversight in tsearch type check. Use IsBinaryCoercible() method instead of custom is_expected_type/is_text_type functions which was introduced when tsearch2 was moved into core. Per report by David E. Wheeler. Analysis by Tom Lane. Patch by me. http://git.postgresql.org/pg/commitdiff/9acb9007de30b3daaa9efc16763c3bc6e3e0a92d Fujii Masao pushed: - Improve log messages related to tablespace_map file. This patch changes the log message which is logged when the server successfully renames backup_label file to *.old but fails to rename tablespace_map file during the shutdown. Previously the WARNING message "online backup mode was not canceled" was logged in that case. However this message is confusing because the backup mode is treated as canceled whenever backup_label is successfully renamed. So this commit makes the server log the message "online backup mode canceled" in that case. Also this commit changes errdetail messages so that they follow the error message style guide. Back-patch to 9.5 where tablespace_map file is introduced. Original patch by Amit Kapila, heavily modified by me. http://git.postgresql.org/pg/commitdiff/10fbb79f1a918124f39fc8a87b8d19db3712202f - Fix comment regarding the meaning of infinity for timeline history entry. Michael Paquier http://git.postgresql.org/pg/commitdiff/05ec71eea265622e1a311c9de3d3b186924e736a Stephen Frost pushed: - Add POLICY to COMMENT documentation. COMMENT supports POLICY but the documentation hadn't caught up with that fact. Patch by Charles Clavadetscher Back-patch to 9.5 where POLICY was added. http://git.postgresql.org/pg/commitdiff/6820094d1ad37429f910cf46e9f3771ebe93347c - Enforce ALL/SELECT policies in RETURNING for RLS. For the UPDATE/DELETE RETURNING case, filter the records which are not visible to the user through ALL or SELECT policies from those considered for the UPDATE or DELETE. This is similar to how the GRANT system works, which prevents RETURNING unless the caller has SELECT rights on the relation. Per discussion with Robert, Dean, Tom, and Kevin. Back-patch to 9.5 where RLS was introduced. http://git.postgresql.org/pg/commitdiff/4f3b2a8883c47b6710152a8e157f8a02656d0e68 - RLS refactoring. This refactors rewrite/rowsecurity.c to simplify the handling of the default deny case (reducing the number of places where we check for and add the default deny policy from three to one) by splitting up the retrival of the policies from the application of them. This also allowed us to do away with the policy_id field. A policy_name field was added for WithCheckOption policies and is used in error reporting, when available. Patch by Dean Rasheed, with various mostly cosmetic changes by me. Back-patch to 9.5 where RLS was introduced to avoid unnecessary differences, since we're still in alpha, per discussion with Robert. http://git.postgresql.org/pg/commitdiff/22eaf35c1d247407b7cf1fffb310a26cd9b9ceb1 Tom Lane pushed: - Revert "Fix an O(N^2) problem in foreign key references". Commit 5ddc72887a012f6a8b85707ef27d85c274faf53d does not actually work because it will happily blow away ri_constraint_cache entries that are in active use in outer call levels. In any case, it's a very ugly, brute-force solution to the problem of limiting the cache size. Revert until it can be redesigned. http://git.postgresql.org/pg/commitdiff/3d9e8db9e56beb0501d168779ae9644587924061 - Remove no-longer-used T_PrivGrantee node tag. Oversight in commit 31eae6028eca4365e7165f5f33fee1ed0486aee0, which replaced PrivGrantee nodes with RoleSpec nodes. Spotted by Yugo Nagata. http://git.postgresql.org/pg/commitdiff/ad584a08c1f19742bf971a52b71a073b9cfcfd50 - Don't use "#" as an abbreviation for "number" in PL/Tcl error messages. Also, rewrite one error message to make it follow our message style guidelines better. Euler Taveira and Tom Lane http://git.postgresql.org/pg/commitdiff/4d0fc1d54b465d4a40b3cf89908438533680e7f3 - Fix documentation of regular expression character-entry escapes. The docs claimed that \uhhhh would be interpreted as a Unicode value regardless of the database encoding, but it's never been implemented that way: \uhhhh and \xhhhh actually mean exactly the same thing, namely the character that pg_mb2wchar translates to 0xhhhh. Moreover we were falsely dismissive of the usefulness of Unicode code points above FFFF. Fix that. It's been like this for ages, so back-patch to all supported branches. http://git.postgresql.org/pg/commitdiff/d0f18cde7e40f1f6412bb35e8645888cd620682f - Sync regex code with Tcl 8.6.4. Sync our regex code with upstream changes since last time we did this, which was Tcl 8.5.11 (see commit 08fd6ff37f71485e2fc04bc6ce07d2a483c36702). The only functional change here is to disbelieve that an octal escape is three digits long if it would exceed \377. That's a bug fix, but it's a minor one and could change the interpretation of working regexes, so don't back-patch. In addition to that, s/INFINITY/DUPINF/ to eliminate the risk of collisions with <math.h>'s macro, and s/LOCAL/NOPROP/ because that also seems like an unnecessarily collision-prone macro name. There were some other cosmetic changes in their copy that I did not adopt, notably a rather half-hearted attempt at renaming some of the C functions in a more verbose style. (I'm not necessarily against the concept, but renaming just a few functions in the package is not an improvement.) http://git.postgresql.org/pg/commitdiff/b44d92b67b65a76f92448b5a282aae72820ac676 - Fix low-probability memory leak in regex execution. After an internal failure in shortest() or longest() while pinning down the exact location of a match, find() forgot to free the DFA structure before returning. This is pretty unlikely to occur, since we just successfully ran the "search" variant of the DFA; but it could happen, and it would result in a session-lifespan memory leak since this code uses malloc() directly. Problem seems to have been aboriginal in Spencer's library, so back-patch all the way. In passing, correct a thinko in a comment I added awhile back about the meaning of the "ntree" field. I happened across these issues while comparing our code to Tcl's version of the library. http://git.postgresql.org/pg/commitdiff/d9c0c728afe734b7087dbb9a4bc16d5b682d139d - Be more wary about partially-valid LOCALLOCK data in RemoveLocalLock(). RemoveLocalLock() must consider the possibility that LockAcquireExtended() failed to palloc the initial space for a locallock's lockOwners array. I had evidently meant to cope with this hazard when the code was originally written (commit 1785acebf2ed14fd66955e2d9a55d77a025f418d), but missed that the pfree needed to be protected with an if-test. Just to make sure things are left in a clean state, reset numLockOwners as well. Per low-memory testing by Andreas Seltenreich. Back-patch to all supported branches. http://git.postgresql.org/pg/commitdiff/ba51774d87a2a0402628f7bd68295c0b2913cc25 Peter Eisentraut pushed: - Fix whitespace http://git.postgresql.org/pg/commitdiff/000a21336b8e218deb856f73dc8972073cb8a649 - Review program help output for wording and formatting http://git.postgresql.org/pg/commitdiff/5878a377ba47a39d8d3ecc1240986916eb9dbaf5 - Order some new options on man pages more sensibly, minor improvements http://git.postgresql.org/pg/commitdiff/213335c14529a8d5e2007ec0c256f4cf64d62d3b - Remove trailing slashes from directories in find command. BSD find is not very smart and ends up writing double slashes into the output in those cases. Also, xgettext is not very smart and splits the file names incorrectly in those cases, resulting in slightly incorrect file names being written into the POT file. http://git.postgresql.org/pg/commitdiff/f2dd10613e7fdd40cb4f543d86e7ef19f6d0a6e4 - Simplify GETTEXT_FILES list http://git.postgresql.org/pg/commitdiff/85eda7e92c936470515b73682cacabe972e69adc - Add missing serial comma http://git.postgresql.org/pg/commitdiff/4a1e15e4a911502bbfb2f36a18e6b930b6caf85d Robert Haas pushed: - Determine whether it's safe to attempt a parallel plan for a query. Commit 924bcf4f16d54c55310b28f77686608684734f42 introduced a framework for parallel computation in PostgreSQL that makes most but not all built-in functions safe to execute in parallel mode. In order to have parallel query, we'll need to be able to determine whether that query contains functions (either built-in or user-defined) that cannot be safely executed in parallel mode. This requires those functions to be labeled, so this patch introduces an infrastructure for that. Some functions currently labeled as safe may need to be revised depending on how pending issues related to heavyweight locking under paralllelism are resolved. Parallel plans can't be used except for the case where the query will run to completion. If portal execution were suspended, the parallel mode restrictions would need to remain in effect during that time, but that might make other queries fail. Therefore, this patch introduces a framework that enables consideration of parallel plans only when it is known that the plan will be run to completion. This probably needs some refinement; for example, at bind time, we do not know whether a query run via the extended protocol will be execution to completion or run with a limited fetch count. Having the client indicate its intentions at bind time would constitute a wire protocol break. Some contexts in which parallel mode would be safe are not adjusted by this patch; the default is not to try parallel plans except from call sites that have been updated to say that such plans are OK. This commit doesn't introduce any parallel paths or plans; it just provides a way to determine whether they could potentially be used. I'm committing it on the theory that the remaining parallel sequential scan patches will also get committed to this release, hopefully in the not-too-distant future. Robert Haas and Amit Kapila. Reviewed (in earlier versions) by Noah Misch. http://git.postgresql.org/pg/commitdiff/7aea8e4f2daa4b39ca9d1309a0c4aadb0f7ed81b - Add new function planstate_tree_walker. ExplainPreScanNode knows how to iterate over a generic tree of plan states; factor that logic out into a separate walker function so that other code, such as upcoming patches for parallel query, can also use it. Patch by me, reviewed by Tom Lane. http://git.postgresql.org/pg/commitdiff/8dd401aa07b91d46f81e51321523864d32843523 - Glue layer to connect the executor to the shm_mq mechanism. The shm_mq mechanism was built to send error (and notice) messages and tuples between backends. However, shm_mq itself only deals in raw bytes. Since commit 2bd9e412f92bc6a68f3e8bcb18e04955cc35001d, we have had infrastructure for one message to redirect protocol messages to a queue and for another backend to parse them and do useful things with them. This commit introduces a somewhat analogous facility for tuples by adding a new type of DestReceiver, DestTupleQueue, which writes each tuple generated by a query into a shm_mq, and a new TupleQueueFunnel facility which reads raw tuples out of the queue and reconstructs the HeapTuple format expected by the executor. The TupleQueueFunnel abstraction supports reading from multiple tuple streams at the same time, but only in round-robin fashion. Someone could imaginably want other policies, but this should be good enough to meet our short-term needs related to parallel query, and we can always extend it later. This also makes one minor addition to the shm_mq API that didn' seem worth breaking out as a separate patch. Extracted from Amit Kapila's parallel sequential scan patch. This code was originally written by me, and then it was revised by Amit, and then it was revised some more by me. http://git.postgresql.org/pg/commitdiff/4a4e6893aa080b9094dadbe0e65f8a75fee41ac6 Michael Meskes pushed: - Let compiler handle size calculation of bool types. Back in the day this did not work, but modern compilers should handle it themselves. http://git.postgresql.org/pg/commitdiff/293fd7c77e40cdf06b7a9eb6db95379be8869b04 Andrew Dunstan pushed: - Honour TEMP_CONFIG when testing pg_upgrade This setting contains extra configuration for the temp instance, as used in pg_regress' --temp-config flag. Backpatch to 9.2 where test.sh was introduced. http://git.postgresql.org/pg/commitdiff/5f7c804ba155cc696297f06a819721f36a731181 - Cache argument type information in json(b) aggregate functions. These functions have been looking up type info for every row they process. Instead of doing that we only look them up the first time through and stash the information in the aggregate state object. Affects json_agg, json_object_agg, jsonb_agg and jsonb_object_agg. There is plenty more work to do in making these more efficient, especially the jsonb functions, but this is a virtually cost free improvement that can be done right away. Backpatch to 9.5 where the jsonb variants were introduced. http://git.postgresql.org/pg/commitdiff/c00c3249e3247d24751d97ff6f26603810593414 == Rejected Patches (for now) == No one was disappointed this week :-) == Pending Patches == Egon Kocjan sent in a patch to add a command line option for pg_ctl on Windows to redirect logging of errors (write_stderr). Teodor Sigaev sent in another revision of a patch to add GiST support for UUIDs. Franck Verrot sent in two more revisions of a patch to report column for which type coercion fails. Andres Freund sent in a patch to move PinBuffer and UnpinBuffer to atomics. Andrew Dunstan sent in a patch to cache type info in json_agg and friends. Kyotaro HORIGUCHI sent in a patch to enable index-only scans with partial indexes. Alexander Shulgin sent in three more revisions of a patch to enable getting the query plans of running queries using auto_explain and signals. Petr Jelinek sent in a patch to remove the on start check for track_commit_timestamp being same in config and control file. Peter Eisentraut sent in a patch mostly of historical interest to fix some SSL issues. Fabien COELHO sent in another revision of a patch to mark pgbench progress with timestamps. Jesper Pedersen sent in three revisions of a patch to add additional LWLOCK_STATS statistics. Fabien COELHO sent in two more revisions of a patch to extend pgbench expressions with functions. Petr Jelinek sent in two more revisions of a patch to implement CREATE EXTENSION ... CASCADE. Amit Langote sent in a patch to remove obsolete cross-references to set_append_rel_pathlist in comments. Kyotaro HORIGUCHI sent in a patch to remove the no-longer-needed T_PrivGrantee from NodeTag in src/include/nodes/nodes.h. Thomas Munro sent in a patch to remove obsolete use of volatile in walsender.c, walreceiver.c, walreceiverfuncs. Anastasia Lubennikova and Teodor Sigaev traded patches to add a microvacuum for gist. Thomas Munro sent in two more revisions of a patch to add a setting which makes synchronous commit apply. Alexander Korotkov sent in another revision of a patch to implement pg_rewind target switch. Daniel Verité sent in two more revisions of a patch to add a \rotate command to psql. Michael Paquier sent in another revision of a patch to improve test coverage of extensions with pg_dump. Dean Rasheed sent in two revisions of a patch to fix some numerical issues with some transcendental functions on NUMERIC. Alexander Korotkov sent in a patch to fix the LW_SHARED_MASK macro. Euler Taveira de Oliveira sent in a patch to standardize some sentences in pg_resetxlog. Michael Paquier sent in another revision of a patch to fix some pg_rewind usability issues. Jan Wieck and Tom Lane traded patches to fix an O(N^2) issue in foreign key references. Robert Haas sent in a patch to number plan nodes in anticipation of parallelization work to follow. SAWADA Masahiko sent in another revision of a patch to add a "frozen" bit to the visibility map. Nikolay Shaplov sent in another revision of a patch to pageinspect which allows showing tuple data. Teodor Sigaev sent in another revision of a patch to add pages deleted from pending list to FSM. Alexander Korotkov sent in another revision of a patch to rework the access method interface. Adrian Vondendriesch sent in a patch to make pg_size_pretty handle negative values. -- Sent via pgsql-announce mailing list (pgsql-announce@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-announce