– Don’t clear btpo_cycleid during _bt_vacuum_one_page. When
“vacuuming” a single btree page by removing LP_DEAD tuples, we are
not actually within a vacuum operation, but rather in an ordinary
insertion process that could well be running concurrently with a
vacuum. So clearing the cycleid is incorrect, and could cause the
concurrent vacuum to miss removing tuples that it needs to remove.
This is a longstanding bug introduced by commit
e6284649b9e30372b3990107a082bc7520325676 of 2006-07-25. I believe
it explains Maxim Boguk’s recent report of index corruption, and
probably some other previously unexplained reports. In 9.0 and up
this is a one-line fix; before that we need to introduce a flag to
tell _bt_delitems what to do.http://git.postgresql.org/pg/commitdiff/593a9631a7947ab95903e87e24786d7e469cc988

– Fix the general case of quantified regex back-references. Cases
where a back-reference is part of a larger subexpression that is
quantified have never worked in Spencer’s regex engine, because he
used a compile-time transformation that neglected the need to check
the back-reference match in iterations before the last one. (That
was okay for capturing parens, and we still do it if the regex has*only* capturing parens … but it’s not okay for backrefs.) To make
this work properly, we have to add an “iteration” node type to the
regex engine’s vocabulary of sub-regex nodes. Since this is a
moderately large change with a fair risk of introducing new bugs of
its own, apply to HEAD only, even though it’s a fix for a
longstanding bug.http://git.postgresql.org/pg/commitdiff/173e29aa5deefd9e71c183583ba37805c8102a72

– Avoid repeated creation/freeing of per-subre DFAs during regex
search. In nested sub-regex trees, lower-level nodes created DFAs
and then destroyed them again before exiting, which is a bit dumb
considering that the recursive search is likely to call those nodes
again later. Instead cache each created DFA until the end of
pg_regexec(). This is basically a space for time tradeoff, in that
it might increase the maximum memory usage. However, in most regex
patterns there are not all that many subre nodes, so not that many
DFAs — and in any case, the peak usage occurs when reaching the
bottom recursion level, and except for alternation cases that’s
going to be the same anyway.http://git.postgresql.org/pg/commitdiff/587359479acbbdc95c8e37da40707e37097423f5

– Merge dissect() into cdissect() to remove a pile of near-duplicate
code. The “uncomplicated” case isn’t materially less complicated
than the full case, certainly not enough so to justify duplicating
nearly 500 lines of code. The only extra work being done in the
full path is zaptreesubs, which is very cheap compared to everything
else being done here, and besides that I’m less than convinced that
it’s not needed in some cases even without backrefs.http://git.postgresql.org/pg/commitdiff/4dd78bf37aa29d04b3f358b08c4a2fa43cf828e7

– Remove useless “retry memory” logic within regex engine. Apparently
some primordial version of Spencer’s engine needed cdissect() and
child functions to be able to continue matching from a previous
position when re-called. That is dead code, though, since trivial
inspection shows that cdissect can never be entered without having
previously done zapmem which resets the relevant retry counter. I
have also verified experimentally that no case in the Tcl regression
tests reaches cdissect with a nonzero retry value. Accordingly,
remove that logic. This doesn’t really save any noticeable number
of cycles in itself, but it is one step towards making dissect() and
cdissect() equivalent, which will allow removing hundreds of lines
of near-duplicated code. Since struct subre’s “retry” field is no
longer particularly related to any kind of retry, rename it to “id”.
As of this commit it’s only used for identifying a subre node in
debug printouts, so you might think we should get rid of the field
entirely; but I have a plan for another use.http://git.postgresql.org/pg/commitdiff/3cbfe485e44d055b9e6a27e47069729375059f8c

– Fix some more bugs in GIN’s WAL replay logic. In commit
4016bdef8aded77b4903c457050622a5a1815c16 I fixed a bunch of
ginxlog.c bugs having to do with not handling XLogReadBuffer
failures correctly. However, in ginRedoUpdateMetapage and
ginRedoDeleteListPages, I unaccountably thought that failure to read
the metapage would be impossible and just put in an elog(PANIC)
call. This is of course wrong: failure is exactly what will happen
if the index got dropped (or rebuilt) between creation of the WAL
record and the crash we’re trying to recover from. I believe this
explains Nicholas Wilson’s recent report of these errors getting
reached. Also, fix memory leak in forgetIncompleteSplit. This
wasn’t of much concern when the code was written, but in a
long-running standby server page split records could be expected to
accumulate indefinitely. Back-patch to 8.4 — before that, GIN
didn’t have a metapage.http://git.postgresql.org/pg/commitdiff/1b630751d0ffef4c856bfe382889d0d187eca404

– Add parameters for controlling locations of server-side SSL files.
This allows changing the location of the files that were previously
hard-coded to server.crt, server.key, root.crt, root.crl.
server.crt and server.key continue to be the default settings and
are thus required to be present by default if SSL is enabled. But
the settings for the server-side CA and CRL are now empty by
default, and if they are set, the files are required to be present.
This replaces the previous behavior of ignoring the functionality if
the files were not found.http://git.postgresql.org/pg/commitdiff/a445cb92ef5b3a31313ebce30e18cc1d6e0bdecb

– Make each pg_stat_ view into it’s own table in the documentation
This makes it easier to match a column name with the description of
it, and makes it possible to add more detailed documentation in the
future. This patch does not add that extra documentation at this
point, only the structure required for it. Modeled on the changes
already done to pg_stat_activity.http://git.postgresql.org/pg/commitdiff/da9ed7dafdc49e6571d056d92f2ef67858d68946