1. 07 Sep, 2017 2 commits
    • Tom Lane's avatar
      Further marginal hacking on generic atomic ops. · bfea9256
      Tom Lane authored
      In the generic atomic ops that rely on a loop around a CAS primitive,
      there's no need to force the initial read of the "old" value to be atomic.
      In the typically-rare case that we get a torn value, that simply means
      that the first CAS attempt will fail; but it will update "old" to the
      atomically-read value, so the next attempt has a chance of succeeding.
      It was already being done that way in pg_atomic_exchange_u64_impl(),
      but let's duplicate the approach in the rest.
      
      (Given the current coding of the pg_atomic_read functions, this change
      is a no-op anyway on popular platforms; it only makes a difference where
      pg_atomic_read_u64_impl() is implemented as a CAS.)
      
      In passing, also remove unnecessary take-a-pointer-and-dereference-it
      coding in the pg_atomic_read functions.  That seems to have been based
      on a misunderstanding of what the C standard requires.  What actually
      matters is that the pointer be declared as pointing to volatile, which
      it is.
      
      I don't believe this will change the assembly code at all on x86
      platforms (even ignoring the likelihood that these implementations
      get overridden by others); but it may help on less-mainstream CPUs.
      
      Discussion: https://postgr.es/m/13707.1504718238@sss.pgh.pa.us
      bfea9256
    • Simon Riggs's avatar
      Exclude special values in recovery_target_time · f06588a8
      Simon Riggs authored
      recovery_target_time accepts timestamp input, though
      does not allow use of special values, e.g. “today”.
      Report a useful error message for these cases.
      
      Reported-by: Piotr Stefaniak
      Author: Simon Riggs
      Discussion: https://postgr.es/m/CANP8+jJdKA+BkkYLWz9zAm16Y0s2ExBv0WfpAwXdTpPfWnA9Bg@mail.gmail.com
      f06588a8
  2. 06 Sep, 2017 9 commits
  3. 05 Sep, 2017 12 commits
  4. 04 Sep, 2017 4 commits
    • Tom Lane's avatar
      Be more careful about newline-chomping in pgbench. · 0b707d6e
      Tom Lane authored
      process_backslash_command would drop the last character of the input
      command on the assumption that it was a newline.  Given a non newline
      terminated input file, this could result in dropping the last character
      of the command.  Fix that by doing an actual test that we're removing
      a newline.
      
      While at it, allow for Windows newlines (\r\n), and suppress multiple
      newlines if any.  I do not think either of those cases really occur,
      since (a) we read script files in text mode and (b) the lexer stops
      when it hits a newline.  But it's cheap enough and it provides a
      stronger guarantee about what the result string looks like.
      
      This is just cosmetic, I think, since the possibly-overly-chomped
      line was only used for display not for further processing.  So
      it doesn't seem necessary to back-patch.
      
      Fabien Coelho, reviewed by Nikolay Shaplov, whacked around a bit by me
      
      Discussion: https://postgr.es/m/alpine.DEB.2.20.1704171422500.4025@lancre
      0b707d6e
    • Tom Lane's avatar
      Fix some subtle problems in pgbench transaction stats counting. · c23bb6ba
      Tom Lane authored
      With --latency-limit, transactions might get skipped even beyond the
      transaction count limit specified by -t, throwing off the expected
      number of transactions and thus the denominator for later stats.
      Be sure to stop skipping transactions once -t is reached.
      
      Also, include skipped transactions in the "cnt" fields; this requires
      discounting them again in a couple of places, but most places are
      better off with this definition.  In particular this is needed to
      get correct overall stats for the combination of -R/-L/-t options.
      Merge some more processing into processXactStats() to simplify this.
      
      In passing, add a check that --progress-timestamp is specified only
      when --progress is.
      
      We might consider back-patching this, but given that it only matters
      for a combination of options, and given the lack of field complaints,
      consensus seems to be not to bother.
      
      Fabien Coelho, reviewed by Nikolay Shaplov
      
      Discussion: https://postgr.es/m/alpine.DEB.2.20.1704171422500.4025@lancre
      c23bb6ba
    • Tom Lane's avatar
      Adjust pgbench to allow non-ASCII characters in variable names. · 9d36a386
      Tom Lane authored
      This puts it in sync with psql's notion of what is a valid variable name.
      Like psql, we document that "non-Latin letters" are allowed, but actually
      any non-ASCII character is accepted.
      
      Fabien Coelho
      
      Discussion: https://postgr.es/m/20170405.094548.1184280384967203518.t-ishii@sraoss.co.jp
      9d36a386
    • Alvaro Herrera's avatar
  5. 03 Sep, 2017 2 commits
  6. 02 Sep, 2017 1 commit
  7. 01 Sep, 2017 10 commits