Robert Haas [Fri, 23 Oct 2015 02:01:11 +0000 (22:01 -0400)]     shm_mq: Repair breakage from previous commit.
 
 If the counterparty writes some data into the queue and then detaches,
 it's wrong to return SHM_MQ_DETACHED right away.  If we do that, we
 fail to read whatever was written.
 
 
    Robert Haas [Thu, 22 Oct 2015 21:00:53 +0000 (17:00 -0400)]     Add two missing cases to ATWrongRelkindError.
 
 This way, we produce a better error message if someone tries to do
 something like ALTER INDEX .. ALTER COLUMN .. SET STORAGE.
 
 Amit Langote
 
 
    Robert Haas [Thu, 22 Oct 2015 20:33:30 +0000 (16:33 -0400)]     shm_mq: Fix failure to notice a dead counterparty when nowait is used.
 
 The shm_mq mechanism was intended to optionally notice when the process
 on the other end of the queue fails to attach to the queue.  It does
 this by allowing the user to pass a BackgroundWorkerHandle; if the
 background worker in question is launched and dies without attaching
 to the queue, then we know it never will.  This logic works OK in
 blocking mode, but when called with nowait = true we fail to notice
 that this has happened due to an asymmetry in the logic.  Repair.
 
 Reported off-list by Rushabh Lathia.  Patch by me.
 
 
    Robert Haas [Thu, 22 Oct 2015 18:51:49 +0000 (14:51 -0400)]     Fix typos in comments.
 
 CharSyam
 
 
    Peter Eisentraut [Thu, 22 Oct 2015 17:59:58 +0000 (13:59 -0400)]     doc: Add advice on updating checkpoint_segments to max_wal_size
 
 with suggestion from Michael Paquier
 
 
    Tom Lane [Thu, 22 Oct 2015 16:33:51 +0000 (09:33 -0700)]     Remove redundant CREATEUSER/NOCREATEUSER options in CREATE ROLE et al.
 
 Once upon a time we did not have a separate CREATEROLE privilege, and
 CREATEUSER effectively meant SUPERUSER.  When we invented CREATEROLE
 (in 8.1) we also added SUPERUSER so as to have a less confusing keyword
 for this role property.  However, we left CREATEUSER in place as a
 deprecated synonym for SUPERUSER, because of backwards-compatibility
 concerns.  It's still there and is still confusing people, as for example
 in bug #13694 from Justin Catterson.  9.6 will be ten years or so later,
 which surely ought to be long enough to end the deprecation and just
 remove these old keywords.  Hence, do so.
 
 
    Robert Haas [Thu, 22 Oct 2015 14:49:20 +0000 (10:49 -0400)]     Fix a couple of bugs in recent parallelism-related commits.
  Commit 
816e336f12ecabdc834d4cc31bcf966b2dd323dc added the wrong error
 check to async.c; sending restrictions is restricted to the leader,
 not altogether unsafe. 
 Commit 
3bd909b220930f21d6e15833a17947be749e7fde added ExecShutdownNode
 to traverse the planstate tree and call shutdown functions, but made
 a Gather node, the only node that actually has such a function, abort
 the tree traversal, which is wrong.  
  Robert Haas [Thu, 22 Oct 2015 14:37:24 +0000 (10:37 -0400)]     Add header comments to execParallel.c and nodeGather.c.
 
 Patch by me, per a note from Simon Riggs.  Reviewed by Amit Kapila
 and Amit Langote.
 
 
    Peter Eisentraut [Thu, 22 Oct 2015 02:31:56 +0000 (22:31 -0400)]     doc: Improve markup and fine-tune replication protocol documentation
 
 
    Tom Lane [Tue, 20 Oct 2015 18:06:24 +0000 (11:06 -0700)]     Fix incorrect translation of minus-infinity datetimes for json/jsonb.
  Commit 
bda76c1c8cfb1d11751ba6be88f0242850481733 caused both plus and
 minus infinity to be rendered as "infinity", which is not only wrong
 but inconsistent with the pre-9.4 behavior of to_json().  Fix that by
 duplicating the coding in date_out/timestamp_out/timestamptz_out more
 closely.  Per bug #13687 from Stepan Perlov.  Back-patch to 9.4, like
 the previous commit. 
 In passing, also re-pgindent json.c, since it had gotten a bit messed up by
 recent patches (and I was already annoyed by indentation-related problems
 in back-patching this fix ...)  
  Peter Eisentraut [Tue, 20 Oct 2015 17:33:39 +0000 (13:33 -0400)]     doc: Move documentation of max_wal_size to better position
 
 
    Robert Haas [Tue, 20 Oct 2015 15:11:35 +0000 (11:11 -0400)]     Fix incorrect comment in plannodes.h
 
 Etsuro Fujita
 
 
    Robert Haas [Tue, 20 Oct 2015 14:29:19 +0000 (10:29 -0400)]     Remove duplicate word.
 
 Amit Langote
 
 
    Robert Haas [Tue, 20 Oct 2015 14:27:20 +0000 (10:27 -0400)]     Tab complete CREATE EXTENSION .. VERSION.
 
 Jeff Janes
 
 
    Robert Haas [Tue, 20 Oct 2015 13:56:04 +0000 (09:56 -0400)]     Put back ssl_renegotiation_limit parameter, but only allow 0.
 
 Per a report from Shay Rojansky, Npgsql sends ssl_renegotiation_limit=0
 in the startup packet because it does not support renegotiation; other
 clients which have not attempted to support renegotiation might well
 behave similarly.  The recent removal of this parameter forces them to
 break compatibility with either current PostgreSQL versions, or
 previous ones.  Per discussion, the best solution is to accept the
 parameter but only allow a value of 0.
 
 Shay Rojansky, edited a little by me.
 
 
    Robert Haas [Tue, 20 Oct 2015 13:27:50 +0000 (09:27 -0400)]     Be a bit more rigorous about how we cache strcoll and strxfrm results.
  Commit 
0e57b4d8bd9674adaf5747421b3255b85e385534 contained some clever
 logic that attempted to make sure that we couldn't get confused about
 whether the last thing we cached was a strcoll() result or a strxfrm()
 result, but it wasn't quite clever enough, because we can perform
 further abbreviations after having already performed some comparisons.
 Introduce an explicit flag in the hopes of making this watertight. 
 Peter Geoghegan, reviewed by me.  
  Robert Haas [Tue, 20 Oct 2015 13:15:13 +0000 (09:15 -0400)]     Remove obsolete comment.
 
 Peter Geoghegan
 
 
    Noah Misch [Tue, 20 Oct 2015 04:37:22 +0000 (00:37 -0400)]     Eschew "RESET statement_timeout" in tests.
 
 Instead, use transaction abort.  Given an unlucky bout of latency, the
 timeout would cancel the RESET itself.  Buildfarm members gharial,
 lapwing, mereswine, shearwater, and sungazer witness that.  Back-patch
 to 9.1 (all supported versions).  The query_canceled test still could
 timeout before entering its subtransaction; for whatever reason, that
 has yet to happen on the buildfarm.
 
 
    Tom Lane [Mon, 19 Oct 2015 20:54:53 +0000 (13:54 -0700)]     Fix incorrect handling of lookahead constraints in pg_regprefix().
 
 pg_regprefix was doing nothing with lookahead constraints, which would
 be fine if it were the right kind of nothing, but it isn't: we have to
 terminate our search for a fixed prefix, not just pretend the LACON arc
 isn't there.  Otherwise, if the current state has both a LACON outarc and a
 single plain-color outarc, we'd falsely conclude that the color represents
 an addition to the fixed prefix, and generate an extracted index condition
 that restricts the indexscan too much.  (See added regression test case.)
 
 Terminating the search is conservative: we could traverse the LACON arc
 (thus assuming that the constraint can be satisfied at runtime) and then
 examine the outarcs of the linked-to state.  But that would be a lot more
 work than it seems worth, because writing a LACON followed by a single
 plain character is a pretty silly thing to do.
 
 This makes a difference only in rather contrived cases, but it's a bug,
 so back-patch to all supported branches.
 
 
    Robert Haas [Fri, 16 Oct 2015 21:25:02 +0000 (17:25 -0400)]     Add a C API for parallel heap scans.
 
 Using this API, one backend can set up a ParallelHeapScanDesc to
 which multiple backends can then attach.  Each tuple in the relation
 will be returned to exactly one of the scanning backends.  Only
 forward scans are supported, and rescans must be carefully
 coordinated.
 
 This is not exposed to the planner or executor yet.
 
 The original version of this code was written by me.  Amit Kapila
 reviewed it, tested it, and improved it, including adding support for
 synchronized scans, per review comments from Jeff Davis.  Extensive
 testing of this and related patches was performed by Haribabu Kommi.
 Final cleanup of this patch by me.
 
 
    Robert Haas [Fri, 16 Oct 2015 21:18:05 +0000 (17:18 -0400)]     Allow a parallel context to relaunch workers.
 
 This may allow some callers to avoid the overhead involved in tearing
 down a parallel context and then setting up a new one, which means
 releasing the DSM and then allocating and populating a new one.  I
 suspect we'll want to revise the Gather node to make use of this new
 capability, but even if not it may be useful elsewhere and requires
 very little additional code.
 
 
    Tom Lane [Fri, 16 Oct 2015 19:52:12 +0000 (15:52 -0400)]     Miscellaneous cleanup of regular-expression compiler.
 
 Revert our previous addition of "all" flags to copyins() and copyouts();
 they're no longer needed, and were never anything but an unsightly hack.
 
 Improve a couple of infelicities in the REG_DEBUG code for dumping
 the NFA data structure, including adding code to count the total
 number of states and arcs.
 
 Add a couple of missed error checks.
 
 Add some more documentation in the README file, and some regression tests
 illustrating cases that exceeded the state-count limit and/or took
 unreasonable amounts of time before this set of patches.
 
 Back-patch to all supported branches.
 
 
    Tom Lane [Fri, 16 Oct 2015 19:36:16 +0000 (15:36 -0400)]     Improve memory-usage accounting in regular-expression compiler.
 
 This code previously counted the number of NFA states it created, and
 complained if a limit was exceeded, so as to prevent bizarre regex patterns
 from consuming unreasonable time or memory.  That's fine as far as it went,
 but the code paid no attention to how many arcs linked those states.  Since
 regexes can be contrived that have O(N) states but will need O(N^2) arcs
 after fixempties() processing, it was still possible to blow out memory,
 and take a long time doing it too.  To fix, modify the bookkeeping to count
 space used by both states and arcs.
 
 I did not bother with including the "color map" in the accounting; it
 can only grow to a few megabytes, which is not a lot in comparison to
 what we're allowing for states+arcs (about 150MB on 64-bit machines
 or half that on 32-bit machines).
 
 Looking at some of the larger real-world regexes captured in the Tcl
 regression test suite suggests that the most that is likely to be needed
 for regexes found in the wild is under 10MB, so I believe that the current
 limit has enough headroom to make it okay to keep it as a hard-wired limit.
 
 In connection with this, redefine REG_ETOOBIG as meaning "regular
 expression is too complex"; the previous wording of "nfa has too many
 states" was already somewhat inapropos because of the error code's use
 for stack depth overrun, and it was not very user-friendly either.
 
 Back-patch to all supported branches.
 
 
    Tom Lane [Fri, 16 Oct 2015 19:11:49 +0000 (15:11 -0400)]     Improve performance of pullback/pushfwd in regular-expression compiler.
 
 The previous coding would create a new intermediate state every time it
 wanted to interchange the ordering of two constraint arcs.  Certain regex
 features such as \Y can generate large numbers of parallel constraint arcs,
 and if we needed to reorder the results of that, we created unreasonable
 numbers of intermediate states.  To improve matters, keep a list of
 already-created intermediate states associated with the state currently
 being considered by the outer loop; we can re-use such states to place all
 the new arcs leading to the same destination or source.
 
 I also took the trouble to redefine push() and pull() to have a less risky
 API: they no longer delete any state or arc that the caller might possibly
 have a pointer to, except for the specifically-passed constraint arc.
 This reduces the risk of re-introducing the same type of error seen in
 the failed patch for CVE-2007-4772.
 
 Back-patch to all supported branches.
 
 
    Tom Lane [Fri, 16 Oct 2015 18:58:10 +0000 (14:58 -0400)]     Improve performance of fixempties() pass in regular-expression compiler.
 
 The previous coding took something like O(N^4) time to fully process a
 chain of N EMPTY arcs.  We can't really do much better than O(N^2) because
 we have to insert about that many arcs, but we can do lots better than
 what's there now.  The win comes partly from using mergeins() to amortize
 de-duplication of arcs across multiple source states, and partly from
 exploiting knowledge of the ordering of arcs for each state to avoid
 looking at arcs we don't need to consider during the scan.  We do have
 to be a bit careful of the possible reordering of arcs introduced by
 the sort-merge coding of the previous commit, but that's not hard to
 deal with.
 
 Back-patch to all supported branches.
 
 
    Tom Lane [Fri, 16 Oct 2015 18:43:17 +0000 (14:43 -0400)]     Fix O(N^2) performance problems in regular-expression compiler.
 
 Change the singly-linked in-arc and out-arc lists to be doubly-linked,
 so that arc deletion is constant time rather than having worst-case time
 proportional to the number of other arcs on the connected states.
 
 Modify the bulk arc transfer operations copyins(), copyouts(), moveins(),
 moveouts() so that they use a sort-and-merge algorithm whenever there's
 more than a small number of arcs to be copied or moved.  The previous
 method is O(N^2) in the number of arcs involved, because it performs
 duplicate checking independently for each copied arc.  The new method may
 change the ordering of existing arcs for the destination state, but nothing
 really cares about that.
 
 Provide another bulk arc copying method mergeins(), which is unused as
 of this commit but is needed for the next one.  It basically is like
 copyins(), but the source arcs might not all come from the same state.
 
 Replace the O(N^2) bubble-sort algorithm used in carcsort() with a qsort()
 call.
 
 These changes greatly improve the performance of regex compilation for
 large or complex regexes, at the cost of extra space for arc storage during
 compilation.  The original tradeoff was probably fine when it was made, but
 now we care more about speed and less about memory consumption.
 
 Back-patch to all supported branches.
 
 
    Tom Lane [Fri, 16 Oct 2015 18:14:40 +0000 (14:14 -0400)]     Fix regular-expression compiler to handle loops of constraint arcs.
 
 It's possible to construct regular expressions that contain loops of
 constraint arcs (that is, ^ $ AHEAD BEHIND or LACON arcs).  There's no use
 in fully traversing such a loop at execution, since you'd just end up in
 the same NFA state without having consumed any input.  Worse, such a loop
 leads to infinite looping in the pullback/pushfwd stage of compilation,
 because we keep pushing or pulling the same constraints around the loop
 in a vain attempt to move them to the pre or post state.  Such looping was
 previously recognized in CVE-2007-4772; but the fix only handled the case
 of trivial single-state loops (that is, a constraint arc leading back to
 its source state) ... and not only that, it was incorrect even for that
 case, because it broke the admittedly-not-very-clearly-stated API contract
 of the pull() and push() subroutines.  The first two regression test cases
 added by this commit exhibit patterns that result in assertion failures
 because of that (though there seem to be no ill effects in non-assert
 builds).  The other new test cases exhibit multi-state constraint loops;
 in an unpatched build they will run until the NFA state-count limit is
 exceeded.
 
 To fix, remove the code added for CVE-2007-4772, and instead create a
 general-purpose constraint-loop-breaking phase of regex compilation that
 executes before we do pullback/pushfwd.  Since we never need to traverse
 a constraint loop fully, we can just break the loop at any chosen spot,
 if we add clone states that can replicate any sequence of arc transitions
 that would've traversed just part of the loop.
 
 Also add some commentary clarifying why we have to have all these
 machinations in the first place.
 
 This class of problems has been known for some time --- we had a report
 from Marc Mamin about two years ago, for example, and there are related
 complaints in the Tcl bug tracker.  I had discussed a fix of this kind
 off-list with Henry Spencer, but didn't get around to doing something
 about it until the issue was rediscovered by Greg Stark recently.
 
 Back-patch to all supported branches.
 
 
    Robert Haas [Fri, 16 Oct 2015 18:20:36 +0000 (14:20 -0400)]     Remove volatile qualifiers from proc.c and procarray.c
  Prior to commit 
0709b7ee72e4bc71ad07b7120acd117265ab51d0, access to
 variables within a spinlock-protected critical section had to be done
 through a volatile pointer, but that should no longer be necessary. 
 Michael Paquier  
  Robert Haas [Fri, 16 Oct 2015 18:12:20 +0000 (14:12 -0400)]     Remove volatile qualifiers from dynahash.c, shmem.c, and sinvaladt.c
  Prior to commit 
0709b7ee72e4bc71ad07b7120acd117265ab51d0, access to
 variables within a spinlock-protected critical section had to be done
 through a volatile pointer, but that should no longer be necessary. 
 Thomas Munro  
  Robert Haas [Fri, 16 Oct 2015 18:06:22 +0000 (14:06 -0400)]     Remove cautions about using volatile from spin.h.
  Commit 
0709b7ee72e4bc71ad07b7120acd117265ab51d0 obsoleted this comment
 but neglected to update it. 
 Thomas Munro  
  Robert Haas [Fri, 16 Oct 2015 15:58:27 +0000 (11:58 -0400)]     Prohibit parallel query when the isolation level is serializable.
  In order for this to be safe, the code which hands true serializability
 will need to taught that the SIRead locks taken by a parallel worker
 pertain to the same transaction as those taken by the parallel leader.
 Some further changes may be needed as well.  Until the necessary
 adaptations are made, don't generate parallel plans in serializable
 mode, and if a previously-generated parallel plan is used after
 serializable mode has been activated, run it serially. 
 This fixes a bug in commit 
7aea8e4f2daa4b39ca9d1309a0c4aadb0f7ed81b.  
  Robert Haas [Fri, 16 Oct 2015 15:56:02 +0000 (11:56 -0400)]     Rewrite interaction of parallel mode with parallel executor support.
  In the previous coding, before returning from ExecutorRun, we'd shut
 down all parallel workers.  This was dead wrong if ExecutorRun was
 called with a non-zero tuple count; it had the effect of truncating
 the query output.  To fix, give ExecutePlan control over whether to
 enter parallel mode, and have it refuse to do so if the tuple count
 is non-zero.  Rewrite the Gather logic so that it can cope with being
 called outside parallel mode. 
 Commit 
7aea8e4f2daa4b39ca9d1309a0c4aadb0f7ed81b is largely to blame
 for this problem, though this patch modifies some subsequently-committed
 code which relied on the guarantees it purported to make.  
  Robert Haas [Fri, 16 Oct 2015 15:48:48 +0000 (11:48 -0400)]     Mark more functions parallel-restricted or parallel-unsafe.
  Commit 
7aea8e4f2daa4b39ca9d1309a0c4aadb0f7ed81b was overoptimistic
 about the degree of safety associated with running various functions
 in parallel mode.  Functions that take a table name or OID as an
 argument are at least parallel-restricted, because the table might be
 temporary, and we currently don't allow parallel workers to touch
 temporary tables.  Functions that take a query as an argument are
 outright unsafe, because the query could be anything, including a
 parallel-unsafe query. 
 Also, the queue of pending notifications is backend-private, so adding
 to it from a worker doesn't behave correctly.  We could fix this by
 transferring the worker's queue of pending notifications to the master
 during worker cleanup, but that seems like more trouble than it's
 worth for now.  In addition to adjusting the pg_proc.h markings, also
 add an explicit check for this in async.c.  
  Robert Haas [Fri, 16 Oct 2015 15:37:19 +0000 (11:37 -0400)]     Fix a problem with parallel workers being unable to restore role.
  check_role() tries to verify that the user has permission to become the
 requested role, but this is inappropriate in a parallel worker, which
 needs to exactly recreate the master's authorization settings.  So skip
 the check in that case. 
 This fixes a bug in commit 
924bcf4f16d54c55310b28f77686608684734f42.  
  Robert Haas [Fri, 16 Oct 2015 15:31:23 +0000 (11:31 -0400)]     Invalidate caches after cranking up a parallel worker transaction.
  Starting a parallel worker transaction changes our notion of which XIDs
 are in-progress or committed, and our notion of the current command
 counter ID.  Therefore, our view of these caches prior to starting
 this transaction may no longer valid.  Defend against that by clearing
 them. 
 This fixes a bug in commit 
924bcf4f16d54c55310b28f77686608684734f42.  
  Michael Meskes [Fri, 16 Oct 2015 15:29:05 +0000 (17:29 +0200)]     Fix order of arguments in ecpg generated typedef command.
 
 
    Robert Haas [Fri, 16 Oct 2015 13:59:57 +0000 (09:59 -0400)]     Tighten up application of parallel mode checks.
  Commit 
924bcf4f16d54c55310b28f77686608684734f42 failed to enforce
 parallel mode checks during the commit of a parallel worker, because
 we exited parallel mode prior to ending the transaction so that we
 could pop the active snapshot.  Re-establish parallel mode during
 parallel worker commit.  Without this, it's far too easy for unsafe
 actions during the pre-commit sequence to crash the server instead of
 hitting the error checks as intended. 
 Just to be extra paranoid, adjust a couple of the sanity checks in
 xact.c to check not only IsInParallelMode() but also
 IsParallelWorker().  
  Robert Haas [Fri, 16 Oct 2015 13:53:34 +0000 (09:53 -0400)]     Transfer current command counter ID to parallel workers.
  Commit 
924bcf4f16d54c55310b28f77686608684734f42 correctly forbade
 parallel workers to modify the command counter while in parallel mode,
 but it inexplicably neglected to actually transfer the current command
 counter from leader to workers.  This can result in the workers seeing
 a different set of tuples from the leader, which is bad.  Repair.  
  Robert Haas [Fri, 16 Oct 2015 13:42:33 +0000 (09:42 -0400)]     Don't send protocol messages to a shm_mq that no longer exists.
  Commit 
2bd9e412f92bc6a68f3e8bcb18e04955cc35001d introduced a mechanism
 for relaying protocol messages from a background worker to another
 backend via a shm_mq.  However, there was no provision for shutting
 down the communication channel.  Therefore, a protocol message sent
 late in the shutdown sequence, such as a DEBUG message resulting from
 cranking up log_min_messages, could crash the server.  To fix, install
 an on_dsm_detach callback that disables sending messages to the shm_mq
 when the associated DSM is detached.  
  Tom Lane [Thu, 15 Oct 2015 17:46:09 +0000 (13:46 -0400)]     Fix NULL handling in datum_to_jsonb().
 
 The function failed to adhere to its specification that the "tcategory"
 argument should not be examined when the input value is NULL.  This
 resulted in a crash in some cases.  Per bug #13680 from Boyko Yordanov.
 
 In passing, re-pgindent some recent changes in jsonb.c, and fix a rather
 ungrammatical comment.
 
 Diagnosis and patch by Michael Paquier, cosmetic changes by me
 
 
    Robert Haas [Thu, 15 Oct 2015 17:16:03 +0000 (13:16 -0400)]     Revert "Have dtrace depend on object files directly, not objfiles.txt"
  This reverts commit 
73537828537239923a0f827a92b20502a3efa52d.  Per
 report from Tom Lane, this breaks parallel builds.  
  Robert Haas [Thu, 15 Oct 2015 17:00:40 +0000 (13:00 -0400)]     Allow FDWs to push down quals without breaking EvalPlanQual rechecks.
 
 This fixes a long-standing bug which was discovered while investigating
 the interaction between the new join pushdown code and the EvalPlanQual
 machinery: if a ForeignScan appears on the inner side of a paramaterized
 nestloop, an EPQ recheck would re-return the original tuple even if
 it no longer satisfied the pushed-down quals due to changed parameter
 values.
 
 This fix adds a new member to ForeignScan and ForeignScanState and a
 new argument to make_foreignscan, and requires changes to FDWs which
 push down quals to populate that new argument with a list of quals they
 have chosen to push down.  Therefore, I'm only back-patching to 9.5,
 even though the bug is not new in 9.5.
 
 Etsuro Fujita, reviewed by me and by Kyotaro Horiguchi.
 
 
    Alvaro Herrera [Thu, 15 Oct 2015 15:20:11 +0000 (12:20 -0300)]     Fix bogus comments
 
 Author: Amit Langote
 
 
    Bruce Momjian [Tue, 13 Oct 2015 22:25:32 +0000 (18:25 -0400)]     -- email subject limit -----------------------------------------
 -- gitweb summary limit --------------------------
 pg_upgrade:  reorder controldata checks to match program output
 
 Also improve comment for how float8_pass_by_value is used.
 
 Backpatch through 9.5
 
 
    Robert Haas [Tue, 13 Oct 2015 19:39:58 +0000 (15:39 -0400)]     Have dtrace depend on object files directly, not objfiles.txt
 
 Per Mark Johnston, this resolves a build error on FreeBSD related
 to the fact that dtrace is modifying the generated object files
 under the hood.  Consequently, without this, dtrace gets reinvoked
 at install time because the object files have been updated.  This
 is a pretty hacky fix, but it shouldn't hurt anything, and it's
 not clear that it's worth expending any more effort for a feature
 that not too many people are using.
 
 Patch by Mark Johnston.  This is arguably back-patchable as a bug
 fix to the build system, but I'm not certain enough of the
 consequences to try that.  Let's see what the buildfarm (and
 our packagers) think of this change on master first.
 
 
    Robert Haas [Tue, 13 Oct 2015 19:33:07 +0000 (15:33 -0400)]     Improve INSERT .. ON CONFLICT error message.
 
 Peter Geoghegan, reviewed by me.
 
 
    Tom Lane [Tue, 13 Oct 2015 15:21:33 +0000 (11:21 -0400)]     On Windows, ensure shared memory handle gets closed if not being used.
 
 Postmaster child processes that aren't supposed to be attached to shared
 memory were not bothering to close the shared memory mapping handle they
 inherit from the postmaster process.  That's mostly harmless, since the
 handle vanishes anyway when the child process exits -- but the syslogger
 process, if used, doesn't get killed and restarted during recovery from a
 backend crash.  That meant that Windows doesn't see the shared memory
 mapping as becoming free, so it doesn't delete it and the postmaster is
 unable to create a new one, resulting in failure to recover from crashes
 whenever logging_collector is turned on.
 
 Per report from Dmitry Vasilyev.  It's a bit astonishing that we'd not
 figured this out long ago, since it's been broken from the very beginnings
 of out native Windows support; probably some previously-unexplained trouble
 reports trace to this.
 
 A secondary problem is that on Cygwin (perhaps only in older versions?),
 exec() may not detach from the shared memory segment after all, in which
 case these child processes did remain attached to shared memory, posing
 the risk of an unexpected shared memory clobber if they went off the rails
 somehow.  That may be a long-gone bug, but we can deal with it now if it's
 still live, by detaching within the infrastructure introduced here to deal
 with closing the handle.
 
 Back-patch to all supported branches.
 
 Tom Lane and Amit Kapila
 
 
    Tom Lane [Mon, 12 Oct 2015 22:30:36 +0000 (18:30 -0400)]     Fix "pg_ctl start -w" to test child process status directly.
 
 pg_ctl start with -w previously relied on a heuristic that the postmaster
 would surely always manage to create postmaster.pid within five seconds.
 Unfortunately, that fails much more often than we would like on some of the
 slower, more heavily loaded buildfarm members.
 
 We have known for quite some time that we could remove the need for that
 heuristic on Unix by using fork/exec instead of system() to launch the
 postmaster.  This allows us to know the exact PID of the postmaster, which
 allows near-certain verification that the postmaster.pid file is the one
 we want and not a leftover, and it also lets us use waitpid() to detect
 reliably whether the child postmaster has exited or not.
 
 What was blocking this change was not wanting to rewrite the Windows
 version of start_postmaster() to avoid use of CMD.EXE.  That's doable
 in theory but would require fooling about with stdout/stderr redirection,
 and getting the handling of quote-containing postmaster switches to
 stay the same might be rather ticklish.  However, we realized that
 we don't have to do that to fix the problem, because we can test
 whether the shell process has exited as a proxy for whether the
 postmaster is still alive.  That doesn't allow an exact check of the
 PID in postmaster.pid, but we're no worse off than before in that
 respect; and we do get to get rid of the heuristic about how long the
 postmaster might take to create postmaster.pid.
 
 On Unix, this change means that a second "pg_ctl start -w" immediately
 after another such command will now reliably fail, whereas previously
 it would succeed if done within two seconds of the earlier command.
 Since that's a saner behavior anyway, it's fine.  On Windows, the case can
 still succeed within the same time window, since pg_ctl can't tell that the
 earlier postmaster's postmaster.pid isn't the pidfile it is looking for.
 To ensure stable test results on Windows, we can insert a short sleep into
 the test script for pg_ctl, ensuring that the existing pidfile looks stale.
 This hack can be removed if we ever do rewrite start_postmaster(), but that
 no longer seems like a high-priority thing to do.
 
 Back-patch to all supported versions, both because the current behavior
 is buggy and because we must do that if we want the buildfarm failures
 to go away.
 
 Tom Lane and Michael Paquier
 
 
    Noah Misch [Mon, 12 Oct 2015 03:53:35 +0000 (23:53 -0400)]     Use JsonbIteratorToken consistently in automatic variable declarations.
 
 Many functions stored JsonbIteratorToken values in variables of other
 integer types.  Also, standardize order relative to other declarations.
 Expect compilers to generate the same code before and after this change.
 
 
    Peter Eisentraut [Mon, 12 Oct 2015 01:44:27 +0000 (21:44 -0400)]     Fix whitespace
 
 
    Noah Misch [Mon, 12 Oct 2015 00:42:26 +0000 (20:42 -0400)]     Avoid scan-build warning about uninitialized htonl() arguments.
 
 Josh Kupershmidt
 
 
    Noah Misch [Mon, 12 Oct 2015 00:36:07 +0000 (20:36 -0400)]     Make prove_installcheck remove the old log directory, if any.
 
 prove_check already has been doing this.  Back-patch to 9.4, like the
 commit that introduced this logging.
 
 
    Robert Haas [Fri, 9 Oct 2015 23:03:44 +0000 (19:03 -0400)]     Speed up text sorts where the same strings occur multiple times.
 
 Cache strxfrm() blobs across calls made to the text SortSupport
 abbreviation routine.  This can speed up sorting if the same string
 needs to be abbreviated many times in a row.
 
 Also, cache the result of the previous strcoll() comparison, so that
 if we're asked to compare the same strings agin, we do need to call
 strcoll() again.
 
 Perhaps surprisingly, these optimizations don't seem to hurt even when
 they don't help.  memcmp() is really cheap compared to strcoll() or
 strxfrm().
 
 Peter Geoghegan, reviewed by me.
 
 
    Robert Haas [Fri, 9 Oct 2015 19:06:06 +0000 (15:06 -0400)]     Make abbreviated key comparisons for text a bit cheaper.
 
 If we do some byte-swapping while abbreviating, we can do comparisons
 using integer arithmetic rather than memcmp.
 
 Peter Geoghegan, reviewed and slightly revised by me.
 
 
    Robert Haas [Fri, 9 Oct 2015 18:31:04 +0000 (14:31 -0400)]     Remove set_latch_on_sigusr1 flag.
 
 This flag has proven to be a recipe for bugs, and it doesn't seem like
 it can really buy anything in terms of performance.  So let's just
 *always* set the process latch when we receive SIGUSR1 instead of
 trying to do it only when needed.
 
 Per my recent proposal on pgsql-hackers.
 
 
    Stephen Frost [Fri, 9 Oct 2015 14:49:02 +0000 (10:49 -0400)]     Handle append_rel_list in expand_security_qual
 
 During expand_security_quals, we take the security barrier quals on an
 RTE and create a subquery which evaluates the quals.  During this, we
 have to replace any variables in the outer query which refer to the
 original RTE with references to the columns from the subquery.
 
 We need to also perform that replacement for any Vars in the
 append_rel_list.
 
 Only backpatching to 9.5 as we only go through this process in 9.4 for
 auto-updatable security barrier views, which UNION ALL queries aren't.
 
 Discovered by Haribabu Kommi
 
 Patch by Dean Rasheed
 
 
    Tom Lane [Fri, 9 Oct 2015 14:12:03 +0000 (09:12 -0500)]     Fix uninitialized-variable bug.
  For some reason, neither of the compilers I usually use noticed the
 uninitialized-variable problem I introduced in commit 
7e2a18a9161fee7e.
 That's hardly a good enough excuse though.  Committing with brown paper bag
 on head. 
 In addition to putting the operations in the right order, move the
 declaration of "now" inside the loop; there's no need for it to be
 outside, and that does wake up older gcc enough to notice any similar
 future problem. 
 Back-patch to 9.4; earlier versions lack the time-to-SIGKILL stanza
 so there's no bug.  
  Robert Haas [Thu, 8 Oct 2015 17:21:03 +0000 (13:21 -0400)]     Fix typo in docs.
 
 Pallavi Sontakke
 
 
    Robert Haas [Thu, 8 Oct 2015 17:01:36 +0000 (13:01 -0400)]     Add BSWAP64 macro.
 
 This is like BSWAP32, but for 64-bit values.  Since we've got two of
 them now and they have use cases (like sortsupport) beyond CRCs, move
 the definitions to their own header file.
 
 Peter Geoghegan
 
 
    Robert Haas [Thu, 8 Oct 2015 16:29:25 +0000 (12:29 -0400)]     Hyphenate variable-length for consistency.
 
 We hyphenate "fixed-length" earlier in the same sentence, and overall we
 more often use "variable-length" rather than "variable length".
 
 Nikolay Shaplov
 
 
    Robert Haas [Thu, 8 Oct 2015 16:24:51 +0000 (12:24 -0400)]     Correct pg_indent to pgindent in various comments.
 
 David Christensen
 
 
    Andrew Dunstan [Wed, 7 Oct 2015 21:41:45 +0000 (17:41 -0400)]     Factor out encoding specific tests for json
 
 This lets us remove the large alternative results files for the main
 json and jsonb tests, which makes modifying those tests simpler for
 committers and patch submitters.
 
 Backpatch to 9.4 for jsonb and 9.3 for json.
 
 
    Tom Lane [Wed, 7 Oct 2015 20:12:05 +0000 (16:12 -0400)]     Improve documentation of the role-dropping process.
 
 In general one may have to run both REASSIGN OWNED and DROP OWNED to get
 rid of all the dependencies of a role to be dropped.  This was alluded to
 in the REASSIGN OWNED man page, but not really spelled out in full; and in
 any case the procedure ought to be documented in a more prominent place
 than that.  Add a section to the "Database Roles" chapter explaining this,
 and do a bit of wordsmithing in the relevant commands' man pages.
 
 
    Bruce Momjian [Wed, 7 Oct 2015 14:30:54 +0000 (10:30 -0400)]     docs:  add JSONB containment example of a key and empty object
 
 Backpatch through 9.5
 
 
    Bruce Momjian [Wed, 7 Oct 2015 13:42:26 +0000 (09:42 -0400)]     docs:  Map operator @> to the proper SGML escape for '>'
 
 Backpatch through 9.5
 
 
    Bruce Momjian [Wed, 7 Oct 2015 13:06:49 +0000 (09:06 -0400)]     docs:  clarify JSONB operator descriptions
 
 No catalog bump as the catalog changes are for SQL operator comments.
 
 Backpatch through 9.5
 
 
    Tom Lane [Tue, 6 Oct 2015 21:15:27 +0000 (17:15 -0400)]     Perform an immediate shutdown if the postpid file is removed.
 
 The postmaster now checks every minute or so (worst case, at most two
 minutes) that postmaster.pid is still there and still contains its own PID.
 If not, it performs an immediate shutdown, as though it had received
 SIGQUIT.
 
 The original goal behind this change was to ensure that failed buildfarm
 runs would get fully cleaned up, even if the test scripts had left a
 postmaster running, which is not an infrequent occurrence.  When the
 buildfarm script removes a test postmaster's $PGDATA directory, its next
 check on postmaster.pid will fail and cause it to exit.  Previously, manual
 intervention was often needed to get rid of such orphaned postmasters,
 since they'd block new test postmasters from obtaining the expected socket
 address.
 
 However, by checking postmaster.pid and not something else, we can provide
 additional robustness: manual removal of postmaster.pid is a frequent DBA
 mistake, and now we can at least limit the damage that will ensue if a new
 postmaster is started while the old one is still alive.
 
 Back-patch to all supported branches, since we won't get the desired
 improvement in buildfarm reliability otherwise.
 
 
    Robert Haas [Tue, 6 Oct 2015 19:45:02 +0000 (15:45 -0400)]     Remove more volatile qualifiers.
  Prior to commit 
0709b7ee72e4bc71ad07b7120acd117265ab51d0, access to
 variables within a spinlock-protected critical section had to be done
 through a volatile pointer, but that should no longer be necessary.
 This continues work begun in 
df4077cda2eae3eb4a5cf387da0c1e7616e73204 and 
6ba4ecbf477e0b25dd7bde1b0c4e07fc2da19348. 
 Thomas Munro and Michael Paquier  
  Bruce Momjian [Tue, 6 Oct 2015 01:19:16 +0000 (21:19 -0400)]     Have CREATE TABLE LIKE add OID column if any LIKEd table has one
 
 Also, process constraints for LIKEd tables at the end so an OID column
 can be referenced in a constraint.
 
 Report by Tom Lane
 
 
    Bruce Momjian [Tue, 6 Oct 2015 01:03:38 +0000 (21:03 -0400)]     to_number():  allow 'V' to divide by 10^(the number of digits)
 
 to_char('V') already multiplied in a similar manner.
 
 Report by Jeremy Lowery
 
 
    Bruce Momjian [Tue, 6 Oct 2015 00:56:38 +0000 (20:56 -0400)]     psql:  allow \pset C in setting the title, matches \C
 
 Report by David G. Johnston
 
 
    Bruce Momjian [Tue, 6 Oct 2015 00:51:46 +0000 (20:51 -0400)]     to_char(): Do not count negative sign as a digit for time values
 
 For time masks, like HH24, MI, SS, CC, MM, do not count the negative
 sign as part of the zero-padding length specified by the mask, e.g. have
 to_char('-4 years'::interval, 'YY') return '-04', not '-4'.
 
 Report by Craig Ringer
 
 
    Bruce Momjian [Mon, 5 Oct 2015 17:38:36 +0000 (13:38 -0400)]     docs:  update guidelines on when to use GIN and GiST indexes
 
 Report by Tomas Vondra
 
 Backpatch through 9.5
 
 
    Tom Lane [Mon, 5 Oct 2015 16:44:12 +0000 (12:44 -0400)]     Docs: explain contrib/pg_stat_statements' handling of GC failure.
 
 Failure to perform garbage collection now has a user-visible effect, so
 explain that and explain that reducing pgss_max is the way to prevent it.
 Per gripe from Andrew Dunstan.
 
 
    Tom Lane [Mon, 5 Oct 2015 16:19:14 +0000 (12:19 -0400)]     Fix insufficiently-portable regression test case.
 
 Some of the buildfarm members are evidently miserly enough of stack space
 to pass the originally-committed form of this test.  Increase the
 requirement 10X to hopefully ensure that it fails as-expected everywhere.
 
 Security: CVE-2015-5289
 
 
    Tom Lane [Mon, 5 Oct 2015 14:57:15 +0000 (10:57 -0400)]     Last-minute updates for release notes.
 
 Add entries for security and not-quite-security issues.
 
 Security: CVE-2015-5288, CVE-2015-5289
 
 
    Andres Freund [Mon, 5 Oct 2015 14:09:13 +0000 (16:09 +0200)]     Remove outdated comment about relation level autovacuum freeze limits.
  The documentation for the autovacuum_multixact_freeze_max_age and
 autovacuum_freeze_max_age relation level parameters contained:
 "Note that while you can set autovacuum_multixact_freeze_max_age very
 small, or even zero, this is usually unwise since it will force frequent
 vacuuming."
 which hasn't been true since these options were made relation options,
 instead of residing in the pg_autovacuum table (
834a6da4f7). 
 Remove the outdated sentence. Even the lowered limits from 
2596d70 are
 high enough that this doesn't warrant calling out the risk in the CREATE
 TABLE docs. 
 Per discussion with Tom Lane and Alvaro Herrera 
 Discussion: 26377.
1443105453@sss.pgh.pa.us
 Backpatch: 9.0- (in parts)  
  Stephen Frost [Mon, 5 Oct 2015 14:14:49 +0000 (10:14 -0400)]     Add regression tests for INSERT/UPDATE+RETURNING
 
 This adds regressions tests which are specific to INSERT+RETURNING and
 UPDATE+RETURNING to ensure that the SELECT policies are added as
 WithCheckOptions (and should therefore throw an error when the policy is
 violated).
 
 Per suggestion from Andres.
 
 Back-patch to 9.5 as the prior commit was.
 
 
    Noah Misch [Mon, 5 Oct 2015 14:06:30 +0000 (10:06 -0400)]     Prevent stack overflow in query-type functions.
 
 The tsquery, ltxtquery and query_int data types have a common ancestor.
 Having acquired check_stack_depth() calls independently, each was
 missing at least one call.  Back-patch to 9.0 (all supported versions).
 
 
    Noah Misch [Mon, 5 Oct 2015 14:06:29 +0000 (10:06 -0400)]     Prevent stack overflow in container-type functions.
 
 A range type can name another range type as its subtype, and a record
 type can bear a column of another record type.  Consequently, functions
 like range_cmp() and record_recv() are recursive.  Functions at risk
 include operator family members and referents of pg_type regproc
 columns.  Treat as recursive any such function that looks up and calls
 the same-purpose function for a record column type or the range subtype.
 Back-patch to 9.0 (all supported versions).
 
 An array type's element type is never itself an array type, so array
 functions are unaffected.  Recursion depth proportional to array
 dimensionality, found in array_dim_to_jsonb(), is fine thanks to MAXDIM.
 
 
    Noah Misch [Mon, 5 Oct 2015 14:06:29 +0000 (10:06 -0400)]     Prevent stack overflow in json-related functions.
 
 Sufficiently-deep recursion heretofore elicited a SIGSEGV.  If an
 application constructs PostgreSQL json or jsonb values from arbitrary
 user input, application users could have exploited this to terminate all
 active database connections.  That applies to 9.3, where the json parser
 adopted recursive descent, and later versions.  Only row_to_json() and
 array_to_json() were at risk in 9.2, both in a non-security capacity.
 Back-patch to 9.2, where the json type was introduced.
 
 Oskari Saarenmaa, reviewed by Michael Paquier.
 
 Security: CVE-2015-5289
 
 
    Noah Misch [Mon, 5 Oct 2015 14:06:29 +0000 (10:06 -0400)]     pgcrypto: Detect and report too-short crypt() salts.
 
 Certain short salts crashed the backend or disclosed a few bytes of
 backend memory.  For existing salt-induced error conditions, emit a
 message saying as much.  Back-patch to 9.0 (all supported versions).
 
 Josh Kupershmidt
 
 Security: CVE-2015-5288
 
 
    Stephen Frost [Mon, 5 Oct 2015 11:55:13 +0000 (07:55 -0400)]     Apply SELECT policies in INSERT/UPDATE+RETURNING
  Similar to 
7d8db3e, given that INSERT+RETURNING requires SELECT rights
 on the table, apply the SELECT policies as WCOs to the tuples being
 inserted.  Apply the same logic to UPDATE+RETURNING. 
 Back-patch to 9.5 where RLS was added.  
  Stephen Frost [Mon, 5 Oct 2015 11:38:58 +0000 (07:38 -0400)]     Do not write out WCOs in Query
 
 The WithCheckOptions list in Query are only populated during rewrite and
 do not need to be written out or read in as part of a Query structure.
 
 Further, move WithCheckOptions to the bottom and add comments to clarify
 that it is only populated during rewrite.
 
 Back-patch to 9.5 with a catversion bump, as we are still in alpha.
 
 
    Andres Freund [Mon, 5 Oct 2015 09:53:43 +0000 (11:53 +0200)]     Re-Align *_freeze_max_age reloption limits with corresponding GUC limits.
  In 
020235a5754 I lowered the autovacuum_*freeze_max_age minimums to
 allow for easier testing of wraparounds. I did not touch the
 corresponding per-table limits. While those don't matter for the purpose
 of wraparound, it seems more consistent to lower them as well. 
 It's noteworthy that the previous reloption lower limit for
 autovacuum_multixact_freeze_max_age was too high by one magnitude, even
 before 
020235a5754. 
 Discussion: 26377.
1443105453@sss.pgh.pa.us
 Backpatch: back to 9.0 (in parts), like the prior patch  
  Stephen Frost [Mon, 5 Oct 2015 01:05:08 +0000 (21:05 -0400)]     ALTER TABLE .. FORCE ROW LEVEL SECURITY
 
 To allow users to force RLS to always be applied, even for table owners,
 add ALTER TABLE .. FORCE ROW LEVEL SECURITY.
 
 row_security=off overrides FORCE ROW LEVEL SECURITY, to ensure pg_dump
 output is complete (by default).
 
 Also add SECURITY_NOFORCE_RLS context to avoid data corruption when
 ALTER TABLE .. FORCE ROW SECURITY is being used. The
 SECURITY_NOFORCE_RLS security context is used only during referential
 integrity checks and is only considered in check_enable_rls() after we
 have already checked that the current user is the owner of the relation
 (which should always be the case during referential integrity checks).
 
 Back-patch to 9.5 where RLS was added.
 
 
    Tom Lane [Sun, 4 Oct 2015 23:38:00 +0000 (19:38 -0400)]     Release notes for 9.5beta1, 9.4.5, 9.3.10, 9.2.14, 9.1.19, 9.0.23.
 
 
    Tom Lane [Sun, 4 Oct 2015 21:58:29 +0000 (17:58 -0400)]     Improve contrib/pg_stat_statements' handling of garbage collection failure.
 
 If we can't read the query texts file (whether because out-of-memory, or
 for some other reason), give up and reset the file to empty, discarding all
 stored query texts, though not the statistics per se.  We used to leave
 things alone and hope for better luck next time, but the problem is that
 the file is only going to get bigger and even harder to slurp into memory.
 Better to do something that will get us out of trouble.
 
 Likewise reset the file to empty for any other failure within gc_qtexts().
 The previous behavior after a write error was to discard query texts but
 not do anything to truncate the file, which is just weird.
 
 Also, increase the maximum supported file size from MaxAllocSize to
 MaxAllocHugeSize; this makes it more likely we'll be able to do a garbage
 collection successfully.
 
 Also, fix recalculation of mean_query_len within entry_dealloc() to match
 the calculation in gc_qtexts().  The previous coding overlooked the
 possibility of dropped texts (query_len == -1) and would underestimate the
 mean of the remaining entries in such cases, thus possibly causing excess
 garbage collection cycles.
 
 In passing, add some errdetail to the log entry that complains about
 insufficient memory to read the query texts file, which after all was
 Jim Nasby's original complaint.
 
 Back-patch to 9.4 where the current handling of query texts was
 introduced.
 
 Peter Geoghegan, rather editorialized upon by me
 
 
    Andres Freund [Sun, 4 Oct 2015 20:24:13 +0000 (22:24 +0200)]     Fix hstore_plpython test when python3 is used.
  Due to 
b67aaf21e8ef8 / CREATE EXTENSION ... CASCADE the test output
 contains the extension name in yet another place. Since that's variable
 depending on the python version... 
 Add yet another name mangling stanza to regress-python3-mangle.mk. 
 Author: Petr Jelinek  
  Tom Lane [Sun, 4 Oct 2015 19:55:07 +0000 (15:55 -0400)]     Further twiddling of nodeHash.c hashtable sizing calculation.
 
 On reflection, the submitted patch didn't really work to prevent the
 request size from exceeding MaxAllocSize, because of the fact that we'd
 happily round nbuckets up to the next power of 2 after we'd limited it to
 max_pointers.  The simplest way to enforce the limit correctly is to
 round max_pointers down to a power of 2 when it isn't one already.
 
 (Note that the constraint to INT_MAX / 2, if it were doing anything useful
 at all, is properly applied after that.)
 
 
    Tom Lane [Sun, 4 Oct 2015 18:06:40 +0000 (14:06 -0400)]     Fix some issues in new hashtable size calculations in nodeHash.c.
 
 Limit the size of the hashtable pointer array to not more than
 MaxAllocSize, per reports from Kouhei Kaigai and others of "invalid memory
 alloc request size" failures.  There was discussion of allowing the array
 to get larger than that by using the "huge" palloc API, but so far no proof
 that that is actually a good idea, and at this point in the 9.5 cycle major
 changes from old behavior don't seem like the way to go.
 
 Fix a rather serious secondary bug in the new code, which was that it
 didn't ensure nbuckets remained a power of 2 when recomputing it for the
 multiple-batch case.
 
 Clean up sloppy division of labor between ExecHashIncreaseNumBuckets and
 its sole call site.
 
 
    Andrew Dunstan [Sun, 4 Oct 2015 17:28:16 +0000 (13:28 -0400)]     Disallow invalid path elements in jsonb_set
 
 Null path elements and, where the object is an array, invalid integer
 elements now cause an error.
 
 Incorrect behaviour noted by Thom Brown, patch from Dmitry Dolgov.
 
 Backpatch to 9.5 where jsonb_set was introduced
 
 
    Peter Eisentraut [Sun, 4 Oct 2015 15:14:28 +0000 (11:14 -0400)]     Group cluster_name and update_process_title settings together
 
 
    Tom Lane [Sun, 4 Oct 2015 02:27:02 +0000 (22:27 -0400)]     Update 9.5 release notes through today.
 
 
    Tom Lane [Sun, 4 Oct 2015 01:21:30 +0000 (21:21 -0400)]     First-draft release notes for 9.4.5, 9.3.10, 9.2.14, 9.1.19, 9.0.23.
 
 
    Noah Misch [Sun, 4 Oct 2015 00:20:22 +0000 (20:20 -0400)]     Document that row_security is a boolean GUC.
  Oversight in commit 
537bd178c73b1d25938347b17e9e3e62898fc231.
 Back-patch to 9.5, like that commit.  
  Noah Misch [Sun, 4 Oct 2015 00:19:57 +0000 (20:19 -0400)]     Make BYPASSRLS behave like superuser RLS bypass.
 
 Specifically, make its effect independent from the row_security GUC, and
 make it affect permission checks pertinent to views the BYPASSRLS role
 owns.  The row_security GUC thereby ceases to change successful-query
 behavior; it can only make a query fail with an error.  Back-patch to
 9.5, where BYPASSRLS was introduced.
 
 
    Andres Freund [Sat, 3 Oct 2015 19:31:51 +0000 (21:31 +0200)]     Add missed CREATE EXTENSION ... CASCADE regression test adjustment.
 
 
    Andres Freund [Sat, 3 Oct 2015 16:19:37 +0000 (18:19 +0200)]     Add CASCADE support for CREATE EXTENSION.
  Without CASCADE, if an extension has an unfullfilled dependency on
 another extension, CREATE EXTENSION ERRORs out with "required extension
 ... is not installed". That is annoying, especially when that dependency
 is an implementation detail of the extension, rather than something the
 extension's user can make sense of. 
 In addition to CASCADE this also includes a small set of regression
 tests around CREATE EXTENSION. 
 Author: Petr Jelinek, editorialized by Michael Paquier, Andres Freund 
Reviewed-By: Michael Paquier, Andres Freund, Jeff Janes Discussion: 
557E0520.
3040800@2ndquadrant.com  
  Tom Lane [Sat, 3 Oct 2015 14:59:42 +0000 (10:59 -0400)]     Add missing "static" specifier.
 
 Per buildfarm (pademelon, at least, doesn't like this).