1. 06 Sep, 2017 7 commits
    • Simon Riggs's avatar
      Allow SET STATISTICS on expression indexes · 5b6d13ee
      Simon Riggs authored
      Index columns are referenced by ordinal number rather than name, e.g.
      CREATE INDEX coord_idx ON measured (x, y, (z + t));
      ALTER INDEX coord_idx ALTER COLUMN 3 SET STATISTICS 1000;
      
      Incompatibility note for release notes:
      \d+ for indexes now also displays Stats Target
      
      Authors: Alexander Korotkov, with contribution by Adrien NAYRAT
      Review: Adrien NAYRAT, Simon Riggs
      Wordsmith: Simon Riggs
      5b6d13ee
    • Tom Lane's avatar
      Use more of gcc's __sync_fetch_and_xxx builtin functions for atomic ops. · e09db94c
      Tom Lane authored
      In addition to __sync_fetch_and_add, gcc offers __sync_fetch_and_sub,
      __sync_fetch_and_and, and __sync_fetch_and_or, which correspond directly
      to primitive atomic ops that we want.  Testing shows that in some cases
      they generate better code than our generic implementations, so use them.
      
      We've assumed that configure's test for __sync_val_compare_and_swap is
      sufficient to allow assuming that __sync_fetch_and_add is available, so
      make the same assumption for these functions.  Should that prove to be
      wrong, we can add more configure tests.
      
      Yura Sokolov, reviewed by Jesper Pedersen and myself
      
      Discussion: https://postgr.es/m/7f65886daca545067f82bf2b463b218d@postgrespro.ru
      e09db94c
    • Tom Lane's avatar
      Remove duplicate reads from the inner loops in generic atomic ops. · e530be96
      Tom Lane authored
      The pg_atomic_compare_exchange_xxx functions are defined to update
      *expected to whatever they read from the target variable.  Therefore,
      there's no need to do additional explicit reads after we've initialized
      the "old" variable.  The actual benefit of this is somewhat debatable,
      but it seems fairly unlikely to hurt anything, especially since we
      will override the generic implementations in most performance-sensitive
      cases.
      
      Yura Sokolov, reviewed by Jesper Pedersen and myself
      
      Discussion: https://postgr.es/m/7f65886daca545067f82bf2b463b218d@postgrespro.ru
      e530be96
    • Peter Eisentraut's avatar
      doc: Make function synopsis formatting more uniform · 34ae1828
      Peter Eisentraut authored
      Whitespace use was inconsistent in the same chapter.
      34ae1828
    • Peter Eisentraut's avatar
      Escape < and & in SGML · 1c53f612
      Peter Eisentraut authored
      This is not required in SGML, but will be in XML, so this is a step to
      prepare for the conversion to XML.  (It is still not required to escape
      >, but we did it here in some cases for symmetry.)
      
      Add a command-line option to osx/onsgmls calls to warn about unescaped
      occurrences in the future.
      
      Author: Alexander Law <exclusion@gmail.com>
      Author: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
      1c53f612
    • Tom Lane's avatar
      Clean up handling of dropped columns in NAMEDTUPLESTORE RTEs. · 8689e382
      Tom Lane authored
      The NAMEDTUPLESTORE patch piggybacked on the infrastructure for
      TABLEFUNC/VALUES/CTE RTEs, none of which can ever have dropped columns,
      so the possibility was ignored most places.  Fix that, including adding a
      specification to parsenodes.h about what it's supposed to look like.
      
      In passing, clean up assorted comments that hadn't been maintained
      properly by said patch.
      
      Per bug #14799 from Philippe Beaudoin.  Back-patch to v10.
      
      Discussion: https://postgr.es/m/20170906120005.25630.84360@wrigleys.postgresql.org
      8689e382
    • Peter Eisentraut's avatar
      doc: Clarify pg_inherits description · 0b554e4e
      Peter Eisentraut authored
      Reported-by: mjustin.lists@gmail.com
      0b554e4e
  2. 05 Sep, 2017 12 commits
  3. 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
  4. 03 Sep, 2017 2 commits
  5. 02 Sep, 2017 1 commit
  6. 01 Sep, 2017 14 commits