== PostgreSQL Weekly News - November 30 2014 == - Mailing list pgsql-announce

From David Fetter
Subject == PostgreSQL Weekly News - November 30 2014 ==
Date
Msg-id 20141201004006.GB21881@fetter.org
Whole thread Raw
List pgsql-announce
== PostgreSQL Weekly News - November 30 2014 ==

The PGCon 2015 call for papers will go out on Dec 1 2014.
http://www.pgcon.org/2015/papers.php

== PostgreSQL Jobs for November ==

http://archives.postgresql.org/pgsql-jobs/2014-11/threads.php

== PostgreSQL Local ==

PostgreSQL Conference 2014 Tokyo will be held December 5 in Shinagawa.
http://www.postgresql.jp/events/jpug-pgcon2014

FOSDEM PGDay (January 30, 2015) and the FOSDEM PostgreSQL
Dev Room (January 31-February 1, 2015)
http://fosdem2015.pgconf.eu/

pgDaySF 2015 will be held March 10, 2015 in Burlingame, California.
http://sfpostgres.org/pgday-sf-2015-call-for-speakers-and-sponsors/

The CfP is open for Nordic PostgreSQL Day 2015, which will be held
March 11, 2015 in  Copenhagen, Denmark.
http://2015.nordicpgday.org/cfp/

The CfP for PGConf US 2015 is open through December 17th, 2014
Notifications will go out on January 10, 2014.  The event takes place
March 25-27, 2015 in NYC.
http://nyc.pgconf.us/2015/

== 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 david@fetter.org, German language
to pwn@pgug.de, Italian language to pwn@itpug.org.  Spanish language
to pwn@arpug.com.ar.

== Applied Patches ==

Heikki Linnakangas pushed:

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

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

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

- Remove extraneous SGML tag
  http://git.postgresql.org/pg/commitdiff/b7a715800a45be00c513ce9c4371fd47b5324d34

- action_at_recovery_target recovery config option.
  action_at_recovery_target = pause | promote | shutdown.  Petr
  Jelinek.  Reviewed by Muhammad Asif Naeem, Fujji Masao and Simon
  Riggs
  http://git.postgresql.org/pg/commitdiff/aedccb1f6fef988af1d1a25b78151f3773954b4c

Robert Haas pushed:

- Attempt to suppress uninitialized variable warning.  Report by
  Heikki Linnakangas.
  http://git.postgresql.org/pg/commitdiff/a6c84c770efdc85aecbef319b453c997a465bd84

- Add infrastructure to save and restore GUC values.  This is further
  infrastructure for parallelism.  Amit Khandekar, Noah Misch, Robert
  Haas
  http://git.postgresql.org/pg/commitdiff/f5d9698a8400972bd604069a3f15ca33e535ea6e

Peter Eisentraut pushed:

- doc: Fix markup
  http://git.postgresql.org/pg/commitdiff/e6f0a48a6094b4e10a81fc2de82cf896701ff396

Fujii Masao pushed:

- Mark response messages for translation in pg_isready.  Back-patch to
  9.3 where pg_isready was added.  Mats Erik Andersson
  http://git.postgresql.org/pg/commitdiff/e656f5d2475f1c3c4099700a6f636cbfbe946ed2

- Make \watch respect the user's \pset null setting.  Previously
  \watch always ignored the user's \pset null setting.  \pset null
  setting should be ignored for \d and similar queries.  For those,
  the code can reasonably have an opinion about what the presentation
  should be like, since it knows what SQL query it's issuing. This
  argument surely doesn't apply to \watch, so this commit makes \watch
  use the user's \pset null setting.  Back-patch to 9.3 where \watch
  was added.
  http://git.postgresql.org/pg/commitdiff/a5eb85eb6266c99f79144201f1162e5106969575

- Add tab-completion for ALTER TABLE ALTER CONSTRAINT in psql.
  Back-patch to 9.4 where ALTER TABLE ALTER CONSTRAINT was added.
  Michael Paquier, bug reported by Andrey Lizenko.
  http://git.postgresql.org/pg/commitdiff/202cbdf7821b4e83694794bfa9f05a376ccad8cd

Álvaro Herrera pushed:

- Update transaction README for persistent multixacts.  Multixacts are
  now maintained during recovery, but the README didn't get the memo.
  Backpatch to 9.3, where the divergence was introduced.
  http://git.postgresql.org/pg/commitdiff/ae04bf50277ae25ca741cf3322d231c7dfb4c997

- Fix BRIN operator family definitions.  The original definitions were
  leaving no room for cross-type operators, so queries that compared a
  column of one type against something of a different type were not
  taking advantage of the index.  Fix by making the opfamilies more
  like the ones for Btree, and include a few cross-type operator
  classes.  Catalog version bumped.  Per complaints from Hubert
  Lubaczewski, Mark Wong, Heikki Linnakangas.
  http://git.postgresql.org/pg/commitdiff/816e10d80033dd74b3b76fdfd84dffb767316c54

Noah Misch pushed:

- Reimplement 9f80f4835a55a1cbffcda5d23a617917f3286c14 with
  PQconninfo().  Apart from ignoring "hostaddr" set to the empty
  string, this behaves identically to its predecessor.  Back-patch to
  9.4, where the original commit first appeared.  Reviewed by Fujii
  Masao.
  http://git.postgresql.org/pg/commitdiff/64f86fb11e20b55fb742af72d55806f8bdd9cd2d

- Revert "Add libpq function PQhostaddr()." This reverts commit
  9f80f4835a55a1cbffcda5d23a617917f3286c14.  The function returned the
  raw value of a connection parameter, a task served by PQconninfo().
  The next commit will reimplement the psql \conninfo change that way.
  Back-patch to 9.4, where that commit first appeared.
  http://git.postgresql.org/pg/commitdiff/2cda889984a6f5ad405318f9e91202d258383b66

- Remove PQhostaddr() from 9.4 release notes.  Back-patch to 9.4, like
  the feature's removal.
  http://git.postgresql.org/pg/commitdiff/5b12987b2e80fcf3af1f6fd23954da5c453e9e64

== Rejected Patches (for now) ==

No one was disappointed this week :-)

== Pending Patches ==

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.



pgsql-announce by date:

Previous
From: David Fetter
Date:
Subject: == PostgreSQL Weekly News - November 23 2014 ==
Next
From: Tomas Vondra
Date:
Subject: Prague PostgreSQL Developer Day 2015 / announcement & call for papers