1. 13 Jul, 2019 5 commits
  2. 12 Jul, 2019 3 commits
    • Thomas Munro's avatar
      Warn if wal_level is too low when creating a publication. · b31fbe85
      Thomas Munro authored
      Provide a hint to users that they need to increase wal_level before
      subscriptions can work.
      
      Author: Lucas Viecelli, with some adjustments by Thomas Munro
      Reviewed-by: Tom Lane
      Discussion: https://postgr.es/m/CAPjy-57rn5Y9g4e5u--eSOP-7P4QrE9uOZmT2ZcUebF8qxsYhg%40mail.gmail.com
      b31fbe85
    • Tom Lane's avatar
      Fix get_actual_variable_range() to cope with broken HOT chains. · d3751adc
      Tom Lane authored
      Commit 3ca930fc modified get_actual_variable_range() to use a new
      "SnapshotNonVacuumable" snapshot type for selecting tuples that it
      would consider valid.  However, because that snapshot type can accept
      recently-dead tuples, this caused a bug when using a recently-created
      index: we might accept a recently-dead tuple that is an early member
      of a broken HOT chain and does not actually match the index entry.
      Then, the data extracted from the heap tuple would not necessarily be
      an endpoint value of the column; it could even be NULL, leading to
      get_actual_variable_range() itself reporting "found unexpected null
      value in index".  Even without an error, this could lead to poor
      plan choices due to an erroneous notion of the endpoint value.
      
      We can improve matters by changing the code to use the index-only
      scan technique (which didn't exist when get_actual_variable_range was
      originally written).  If any of the tuples in a HOT chain are live
      enough to satisfy SnapshotNonVacuumable, we take the data from the
      index entry, ignoring what is in the heap.  This fixes the problem
      without changing the live-vs-dead-tuple behavior from what was
      intended by commit 3ca930fc.
      
      A side benefit is that for static tables we might not have to touch
      the heap at all (when the extremal value is in an all-visible page).
      In addition, we can save some overhead by not having to create a
      complete ExecutorState, and we don't need to run FormIndexDatum,
      avoiding more cycles as well as the possibility of failure for
      indexes on expressions.  (I'm not sure that this code would ever
      be used to determine the extreme value of an expression, in the
      current state of the planner; but it's definitely possible that
      lower-order columns of the selected index could be expressions.
      So one could construct perhaps-artificial examples in which the
      old code unexpectedly failed due to trying to compute an
      expression's value for a now-dead row.)
      
      Per report from Manuel Rigger.  Back-patch to v11 where commit
      3ca930fc came in.
      
      Discussion: https://postgr.es/m/CA+u7OA7W4NWEhCvftdV6_8bbm2vgypi5nuxfnSEJQqVKFSUoMg@mail.gmail.com
      d3751adc
    • David Rowley's avatar
      Fix RANGE partition pruning with multiple boolean partition keys · cfde2349
      David Rowley authored
      match_clause_to_partition_key incorrectly would return
      PARTCLAUSE_UNSUPPORTED if a bool qual could not be matched to the current
      partition key.  This was a problem, as it causes the calling function to
      discard the qual and not try to match it to any other partition key.  If
      there was another partition key which did match this qual, then the qual
      would not be checked again and we could fail to prune some partitions.
      
      The worst this could do was to cause partitions not to be pruned when they
      could have been, so there was no danger of incorrect query results here.
      
      Fix this by changing match_boolean_partition_clause to have it return a
      PartClauseMatchStatus rather than a boolean value.  This allows it to
      communicate if the qual is unsupported or if it just does not match this
      particular partition key, previously these two cases were treated the
      same.  Now, if match_clause_to_partition_key is unable to match the qual
      to any other qual type then we can simply return the value from the
      match_boolean_partition_clause call so that the calling function properly
      treats the qual as either unmatched or unsupported.
      
      Reported-by: Rares Salcudean
      Reviewed-by: Amit Langote
      Backpatch-through: 11 where partition pruning was introduced
      Discussion: https://postgr.es/m/CAHp_FN2xwEznH6oyS0hNTuUUZKp5PvegcVv=Co6nBXJ+mC7Y5w@mail.gmail.com
      cfde2349
  3. 11 Jul, 2019 1 commit
  4. 10 Jul, 2019 7 commits
  5. 09 Jul, 2019 5 commits
  6. 08 Jul, 2019 5 commits
  7. 07 Jul, 2019 2 commits
  8. 06 Jul, 2019 5 commits
  9. 05 Jul, 2019 7 commits