1. 16 Jun, 2018 4 commits
    • Tom Lane's avatar
      Use snprintf not sprintf in pg_waldump's timestamptz_to_str. · 5d923eb2
      Tom Lane authored
      This could only cause an issue if strftime returned a ridiculously
      long timezone name, which seems unlikely; and it wouldn't qualify
      as a security problem even then, since pg_waldump (nee pg_xlogdump)
      is a debug tool not part of the server.  But gcc 8 has started issuing
      warnings about it, so let's use snprintf and be safe.
      
      Backpatch to 9.3 where this code was added.
      
      Discussion: https://postgr.es/m/21789.1529170195@sss.pgh.pa.us
      5d923eb2
    • Tom Lane's avatar
      Fix some minor error-checking oversights in ParseFuncOrColumn(). · 0dcf68e5
      Tom Lane authored
      Recent additions to ParseFuncOrColumn to make it reject non-procedure
      functions in CALL were neither adequate nor documented.  Reorganize
      the code to ensure uniform results for all the cases that should be
      rejected.  Also, use ERRCODE_WRONG_OBJECT_TYPE for this case as well
      as the converse case of a procedure in a non-CALL context.  The
      original coding used ERRCODE_UNDEFINED_FUNCTION which seems wrong,
      and is certainly inconsistent with the adjacent wrong-kind-of-routine
      errors.
      
      This reorganization also causes the checks for aggregate decoration with
      a non-aggregate function to be made in the FUNCDETAIL_COERCION case;
      that they were not is a long-standing oversight.
      
      Discussion: https://postgr.es/m/14497.1529089235@sss.pgh.pa.us
      0dcf68e5
    • Simon Riggs's avatar
      Remove AELs from subxids correctly on standby · 15378c1a
      Simon Riggs authored
      Issues relate only to subtransactions that hold AccessExclusiveLocks
      when replayed on standby.
      
      Prior to PG10, aborting subtransactions that held an
      AccessExclusiveLock failed to release the lock until top level commit or
      abort. 49bff530 fixed that.
      
      However, 49bff530 also introduced a similar bug where subtransaction
      commit would fail to release an AccessExclusiveLock, leaving the lock to
      be removed sometimes early and sometimes late. This commit fixes
      that bug also. Backpatch to PG10 needed.
      
      Tested by observation. Note need for multi-node isolationtester to improve
      test coverage for this and other HS cases.
      
      Reported-by: Simon Riggs
      Author: Simon Riggs
      15378c1a
    • Tatsuo Ishii's avatar
      Fix memory leak in BufFileCreateShared(). · 1cfdb1cb
      Tatsuo Ishii authored
      Also this commit unifies some duplicated code in makeBufFile() and
      BufFileOpenShared() into new function makeBufFileCommon().
      
      Author: Antonin Houska
      Reviewed-By: Thomas Munro, Tatsuo Ishii
      Discussion: https://postgr.es/m/16139.1529049566%40localhost
      1cfdb1cb
  2. 15 Jun, 2018 3 commits
  3. 14 Jun, 2018 3 commits
  4. 13 Jun, 2018 4 commits
    • Tom Lane's avatar
      Code review for match_clause_to_partition_key(). · 91781335
      Tom Lane authored
      Fix inconsistent decisions about NOMATCH vs UNSUPPORTED result codes.
      If we're going to cater for partkeys that have the same expression and
      different collations, surely we should also support partkeys with the
      same expression and different opclasses.
      
      Clean up shaky handling of commuted opclauses, eg checking the wrong
      operator to see what its negator is.  This wouldn't cause any actual
      bugs given a sane opclass definition, but it doesn't seem helpful to
      expend more code to be less correct.
      
      Improve handling of null elements in ScalarArrayOp arrays: in the
      "op ALL" case, we can conclude they result in an unsatisfiable clause.
      
      Minor cosmetic changes and comment improvements.
      91781335
    • Tom Lane's avatar
      Fix some ill-chosen names for globally-visible partition support functions. · 19832753
      Tom Lane authored
      "compute_hash_value" is particularly gratuitously generic, but IMO
      all of these ought to have names clearly related to partitioning.
      19832753
    • Tom Lane's avatar
      Fix up run-time partition pruning's use of relcache's partition data. · e23bae82
      Tom Lane authored
      The previous coding saved pointers into the partitioned table's relcache
      entry, but then closed the relcache entry, causing those pointers to
      nominally become dangling.  Actual trouble would be seen in the field
      only if a relcache flush occurred mid-query, but that's hardly out of
      the question.
      
      While we could fix this by copying all the data in question at query
      start, it seems better to just hold the relcache entry open for the
      whole query.
      
      While at it, improve the handling of support-function lookups: do that
      once per query not once per pruning test.  There's still something to be
      desired here, in that we fail to exploit the possibility of caching data
      across queries in the fn_extra fields of the relcache's FmgrInfo structs,
      which could happen if we just used those structs in-place rather than
      copying them.  However, combining that with the possibility of per-query
      lookups of cross-type comparison functions seems to require changes in the
      APIs of a lot of the pruning support functions, so it's too invasive to
      consider as part of this patch.  A win would ensue only for complex
      partition key data types (e.g. arrays), so it may not be worth the
      trouble.
      
      David Rowley and Tom Lane
      
      Discussion: https://postgr.es/m/17850.1528755844@sss.pgh.pa.us
      e23bae82
    • Alexander Korotkov's avatar
      Documentation improvement for pg_trgm · e146e4d0
      Alexander Korotkov authored
      Documentation of word_similarity() and strict_word_similarity() functions
      contains some vague wordings which could confuse users.  This patch makes
      those wordings more clear.  word_similarity() was introduced in PostgreSQL 9.6,
      and corresponding part of documentation needs to be backpatched.
      
      Author: Bruce Momjian, Alexander Korotkov
      Discussion: https://postgr.es/m/20180526165648.GB12510%40momjian.us
      Backpatch: 9.6, where word_similarity() was introduced
      e146e4d0
  5. 12 Jun, 2018 5 commits
  6. 11 Jun, 2018 13 commits
  7. 10 Jun, 2018 6 commits
  8. 09 Jun, 2018 1 commit
  9. 08 Jun, 2018 1 commit