1. 06 Apr, 2017 11 commits
    • Peter Eisentraut's avatar
      a071fe87
    • Peter Eisentraut's avatar
      Fix AclResult vs bool type mix-up · 301ca0d9
      Peter Eisentraut authored
      Using AclResult as a bool or vice versa works by accident, but it's
      unusual and possibly confusing style, so write it out more explicitly.
      301ca0d9
    • Alvaro Herrera's avatar
      Comment fixes for extended statistics · b1fc51a3
      Alvaro Herrera authored
      Clean up some code comments in new extended statistics code, from
      7b504eb2.
      b1fc51a3
    • Peter Eisentraut's avatar
      dc0400cc
    • Heikki Linnakangas's avatar
      Remove bogus SCRAM_ITERATION_LEN constant. · 07044efe
      Heikki Linnakangas authored
      It was not used for what the comment claimed, at all. It was actually used
      as the 'base' argument to strtol(), when reading the iteration count. We
      don't need a constant for base-10, so remove it.
      07044efe
    • Simon Riggs's avatar
      Always SnapshotResetXmin() during ClearTransaction() · cd0cebaf
      Simon Riggs authored
      Avoid corner cases during 2PC with 6bad580d
      cd0cebaf
    • Peter Eisentraut's avatar
      Identity columns · 32173270
      Peter Eisentraut authored
      This is the SQL standard-conforming variant of PostgreSQL's serial
      columns.  It fixes a few usability issues that serial columns have:
      
      - CREATE TABLE / LIKE copies default but refers to same sequence
      - cannot add/drop serialness with ALTER TABLE
      - dropping default does not drop sequence
      - need to grant separate privileges to sequence
      - other slight weirdnesses because serial is some kind of special macro
      Reviewed-by: default avatarVitaly Burovoy <vitaly.burovoy@gmail.com>
      32173270
    • Simon Riggs's avatar
      Avoid SnapshotResetXmin() during AtEOXact_Snapshot() · 6bad580d
      Simon Riggs authored
      For normal commits and aborts we already reset PgXact->xmin,
      so we can simply avoid running SnapshotResetXmin() twice.
      
      During performance tests by Alexander Korotkov, diagnosis
      by Andres Freund showed PgXact array as a bottleneck. After
      manual analysis by me of the code paths that touch those
      memory locations, I was able to identify extraneous code
      in the main transaction commit path.
      
      Avoiding touching highly contented shmem improves concurrent
      performance slightly on all workloads, confirmed by tests
      run by Ashutosh Sharma and Alexander Korotkov.
      
      Simon Riggs
      
      Discussion: CANP8+jJdXE9b+b9F8CQT-LuxxO0PBCB-SZFfMVAdp+akqo4zfg@mail.gmail.com
      6bad580d
    • Heikki Linnakangas's avatar
      Remove dead code and fix comments in fast-path function handling. · fd019835
      Heikki Linnakangas authored
      HandleFunctionRequest() is no longer responsible for reading the protocol
      message from the client, since commit 2b3a8b20. Fix the outdated
      comments.
      
      HandleFunctionRequest() now always returns 0, because the code that used
      to return EOF was moved in 2b3a8b20. Therefore, the caller no longer
      needs to check the return value.
      
      Reported by Andres Freund. Backpatch to all supported versions, even though
      this doesn't have any user-visible effect, to make backporting future
      patches in this area easier.
      
      Discussion: https://www.postgresql.org/message-id/20170405010525.rt5azbya5fkbhvrx@alap3.anarazel.de
      fd019835
    • Andres Freund's avatar
      Code review for recent slot.c changes. · 5c21ad07
      Andres Freund authored
      5c21ad07
    • Tom Lane's avatar
      Fix integer-overflow problems in interval comparison. · df1a699e
      Tom Lane authored
      When using integer timestamps, the interval-comparison functions tried
      to compute the overall magnitude of an interval as an int64 number of
      microseconds.  As reported by Frazer McLean, this overflows for intervals
      exceeding about 296000 years, which is bad since we nominally allow
      intervals many times larger than that.  That results in wrong comparison
      results, and possibly in corrupted btree indexes for columns containing
      such large interval values.
      
      To fix, compute the magnitude as int128 instead.  Although some compilers
      have native support for int128 calculations, many don't, so create our
      own support functions that can do 128-bit addition and multiplication
      if the compiler support isn't there.  These support functions are designed
      with an eye to allowing the int128 code paths in numeric.c to be rewritten
      for use on all platforms, although this patch doesn't do that, or even
      provide all the int128 primitives that will be needed for it.
      
      Back-patch as far as 9.4.  Earlier releases did not guard against overflow
      of interval values at all (commit 146604ec fixed that), so it seems not
      very exciting to worry about overly-large intervals for them.
      
      Before 9.6, we did not assume that unreferenced "static inline" functions
      would not draw compiler warnings, so omit functions not directly referenced
      by timestamp.c, the only present consumer of int128.h.  (We could have
      omitted these functions in HEAD too, but since they were written and
      debugged on the way to the present patch, and they look likely to be needed
      by numeric.c, let's keep them in HEAD.)  I did not bother to try to prevent
      such warnings in a --disable-integer-datetimes build, though.
      
      Before 9.5, configure will never define HAVE_INT128, so the part of
      int128.h that exploits a native int128 implementation is dead code in the
      9.4 branch.  I didn't bother to remove it, thinking that keeping the file
      looking similar in different branches is more useful.
      
      In HEAD only, add a simple test harness for int128.h in src/tools/.
      
      In back branches, this does not change the float-timestamps code path.
      That's not subject to the same kind of overflow risk, since it computes
      the interval magnitude as float8.  (No doubt, when this code was originally
      written, overflow was disregarded for exactly that reason.)  There is a
      precision hazard instead :-(, but we'll avert our eyes from that question,
      since no complaints have been reported and that code's deprecated anyway.
      
      Kyotaro Horiguchi and Tom Lane
      
      Discussion: https://postgr.es/m/1490104629.422698.918452336.26FA96B7@webmail.messagingengine.com
      df1a699e
  2. 05 Apr, 2017 12 commits
  3. 04 Apr, 2017 17 commits