1. 16 Sep, 2015 6 commits
    • Tom Lane's avatar
      Sync regex code with Tcl 8.6.4. · b44d92b6
      Tom Lane authored
      Sync our regex code with upstream changes since last time we did this,
      which was Tcl 8.5.11 (see commit 08fd6ff3).
      
      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.)
      b44d92b6
    • Tom Lane's avatar
      Fix documentation of regular expression character-entry escapes. · d0f18cde
      Tom Lane authored
      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.
      d0f18cde
    • Tom Lane's avatar
      Don't use "#" as an abbreviation for "number" in PL/Tcl error messages. · 4d0fc1d5
      Tom Lane authored
      Also, rewrite one error message to make it follow our message style
      guidelines better.
      
      Euler Taveira and Tom Lane
      4d0fc1d5
    • Tom Lane's avatar
      Remove no-longer-used T_PrivGrantee node tag. · ad584a08
      Tom Lane authored
      Oversight in commit 31eae602, which
      replaced PrivGrantee nodes with RoleSpec nodes.  Spotted by Yugo Nagata.
      ad584a08
    • Teodor Sigaev's avatar
      pgbench progress with timestamp · 1def9063
      Teodor Sigaev authored
      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 <coelho@cri.ensmp.fr>
      1def9063
    • Peter Eisentraut's avatar
      5878a377
  2. 15 Sep, 2015 8 commits
    • Stephen Frost's avatar
      Enforce ALL/SELECT policies in RETURNING for RLS · 4f3b2a88
      Stephen Frost authored
      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.
      4f3b2a88
    • Stephen Frost's avatar
      RLS refactoring · 22eaf35c
      Stephen Frost authored
      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.
      22eaf35c
    • Peter Eisentraut's avatar
      Fix whitespace · 000a2133
      Peter Eisentraut authored
      000a2133
    • Tom Lane's avatar
      Revert "Fix an O(N^2) problem in foreign key references". · 3d9e8db9
      Tom Lane authored
      Commit 5ddc7288 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.
      3d9e8db9
    • Stephen Frost's avatar
      Add POLICY to COMMENT documentation · 6820094d
      Stephen Frost authored
      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.
      6820094d
    • Fujii Masao's avatar
      05ec71ee
    • Fujii Masao's avatar
      Improve log messages related to tablespace_map file · 10fbb79f
      Fujii Masao authored
      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.
      10fbb79f
    • Teodor Sigaev's avatar
      Fix wrong comment in commit d0242602 · 0f759285
      Teodor Sigaev authored
      Per gripe from Robert Haas
      0f759285
  3. 14 Sep, 2015 1 commit
  4. 13 Sep, 2015 3 commits
  5. 12 Sep, 2015 2 commits
  6. 11 Sep, 2015 8 commits
    • Robert Haas's avatar
      Install lwlocknames.h even in vpath builds. · a7212a99
      Robert Haas authored
      Per buildfarm member crake.
      a7212a99
    • Bruce Momjian's avatar
      pg_dump, pg_upgrade: allow postgres/template1 tablespace moves · 7f8d090b
      Bruce Momjian authored
      Modify pg_dump to restore postgres/template1 databases to non-default
      tablespaces by switching out of the database to be moved, then switching
      back.
      
      Also, to fix potentially cases where the old/new tablespaces might not
      match, fix pg_upgrade to process new/old tablespaces separately in all
      cases.
      
      Report by Marti Raudsepp
      
      Patch by Marti Raudsepp, me
      
      Backpatch through 9.0
      7f8d090b
    • Robert Haas's avatar
      Fix build problems in commit aa65de04. · 2ccc4e97
      Robert Haas authored
      The previous way didn't work for vpath builds, and make distprep was
      busted too.
      
      Reported off-list by Andres Freund.
      2ccc4e97
    • Alvaro Herrera's avatar
      Add missing ReleaseBuffer call in BRIN revmap code · 5cd65383
      Alvaro Herrera authored
      I think this particular branch is actually dead, but the analysis to
      prove that is not trivial, so instead take the weasel way.
      
      Reported by Jinyu Zhang
      Backpatch to 9.5, where BRIN was introduced.
      5cd65383
    • Kevin Grittner's avatar
      Fix an O(N^2) problem in foreign key references. · 5ddc7288
      Kevin Grittner authored
      Commit 45ba424f improved foreign key lookups during bulk updates
      when the FK value does not change.  When restoring a schema dump
      from a database with many (say 100,000) foreign keys, this cache
      would grow very big and every ALTER TABLE command was causing an
      InvalidateConstraintCacheCallBack(), which uses a sequential hash
      table scan.  This could cause a severe performance regression in
      restoring a schema dump (including during pg_upgrade).
      
      The patch uses a heuristic method of detecting when the hash table
      should be destroyed and recreated.
      InvalidateConstraintCacheCallBack() adds the current size of the
      hash table to a counter.  When that sum reaches 1,000,000, the hash
      table is flushed.  This fixes the regression without noticeable
      harm to the bulk update use case.
      
      Jan Wieck
      Backpatch to 9.3 where the performance regression was introduced.
      5ddc7288
    • Robert Haas's avatar
      When trace_lwlocks is used, identify individual lwlocks by name. · aa65de04
      Robert Haas authored
      Naming the individual lwlocks seems like something that may be useful
      for other types of debugging, monitoring, or instrumentation output,
      but this commit just implements it for the specific case of
      trace_lwlocks.
      
      Patch by me, reviewed by Amit Kapila and Kyotaro Horiguchi
      aa65de04
    • Fujii Masao's avatar
      Correct description of PageHeaderData layout in documentation · a1b28885
      Fujii Masao authored
      Back-patch to 9.3 where PageHeaderData layout was changed.
      
      Michael Paquier
      a1b28885
    • Peter Eisentraut's avatar
      doc: Spell checking · 103ef202
      Peter Eisentraut authored
      103ef202
  7. 10 Sep, 2015 3 commits
    • Tom Lane's avatar
      Fix setrefs.c comment properly. · 87efbc2b
      Tom Lane authored
      The "typo" alleged in commit 1e460d4b was actually a comment that was
      correct when written, but I missed updating it in commit b5282aa8.
      Use a slightly less specific (and hopefully more future-proof) description
      of what is collected.  Back-patch to 9.2 where that commit appeared, and
      revert the comment to its then-entirely-correct state before that.
      87efbc2b
    • Stephen Frost's avatar
      Fix typo in setrefs.c · 1e460d4b
      Stephen Frost authored
      We're adding OIDs, not TIDs, to invalItems.
      
      Pointed out by Etsuro Fujita.
      
      Back-patch to all supported branches.
      1e460d4b
    • Tom Lane's avatar
      Fix minor bug in regexp makesearch() function. · 91cf3135
      Tom Lane authored
      The list-wrangling here was done wrong, allowing the same state to get
      put into the list twice.  The following loop then would clone it twice.
      The second clone would wind up with no inarcs, so that there was no
      observable misbehavior AFAICT, but a useless state in the finished NFA
      isn't an especially good thing.
      91cf3135
  8. 09 Sep, 2015 3 commits
    • Teodor Sigaev's avatar
      Fix oversight in 013ebc0a commit · 223936e2
      Teodor Sigaev authored
      Declaration of varibale inside ÓÝ×Õ
      223936e2
    • Teodor Sigaev's avatar
      Microvacuum for GIST · 013ebc0a
      Teodor Sigaev authored
      Mark index tuple as dead if it's pointed by kill_prior_tuple during
      ordinary (search) scan and remove it during insert process if there is no
      enough space for new tuple to insert. This improves select performance
      because index will not return tuple marked as dead and improves insert
      performance because it reduces number of page split.
      
      Anastasia Lubennikova <a.lubennikova@postgrespro.ru> with
       minor editorialization by me
      013ebc0a
    • Fujii Masao's avatar
      Remove files signaling a standby promotion request at postmaster startup · 96f6a0cb
      Fujii Masao authored
      This commit makes postmaster forcibly remove the files signaling
      a standby promotion request. Otherwise, the existence of those files
      can trigger a promotion too early, whether a user wants that or not.
      
      This removal of files is usually unnecessary because they can exist
      only during a few moments during a standby promotion. However
      there is a race condition: if pg_ctl promote is executed and creates
      the files during a promotion, the files can stay around even after
      the server is brought up to new master. Then, if new standby starts
      by using the backup taken from that master, the files can exist
      at the server startup and should be removed in order to avoid
      an unexpected promotion.
      
      Back-patch to 9.1 where promote signal file was introduced.
      
      Problem reported by Feike Steenbergen.
      Original patch by Michael Paquier, modified by me.
      
      Discussion: 20150528100705.4686.91426@wrigleys.postgresql.org
      96f6a0cb
  9. 08 Sep, 2015 6 commits