1. 11 Nov, 2020 1 commit
  2. 10 Nov, 2020 5 commits
  3. 09 Nov, 2020 8 commits
  4. 08 Nov, 2020 4 commits
    • Tom Lane's avatar
      In INSERT/UPDATE, use the table's real tuple descriptor as target. · 8b39345a
      Tom Lane authored
      This back-patches commit 20d3fe90 into the v12 and v13 branches.
      At the time I thought that commit was not fixing any observable
      bug, but Bertrand Drouvot showed otherwise: adding a dropped column
      to the previously-considered scenario crashes v12 and v13, unless the
      dropped column happens to be an integer.  That is, of course, because
      the tupdesc we derive from the plan output tlist fails to describe
      the dropped column accurately, so that we'll do the wrong thing with
      a tuple in which that column isn't NULL.
      
      There is no bug in pre-v12 branches because they already did use
      the table's real tuple descriptor for any trigger-returned tuple.
      It seems that this set of bugs can be blamed on the changes that
      removed es_trig_tuple_slot, though I've not attempted to pin that
      down precisely.
      
      Although there's no code change needed in HEAD, update the test case
      to include a dropped column there too.
      
      Discussion: https://postgr.es/m/db5d97c8-f48a-51e2-7b08-b73d5434d425@amazon.com
      Discussion: https://postgr.es/m/16644-5da7ef98a7ac4545@postgresql.org
      8b39345a
    • Thomas Munro's avatar
      Fix assertion in collation version lookup. · d50e3b1f
      Thomas Munro authored
      Commit 257836a7 included an assertion that a version lookup routine is
      not trying to look up "C" or "POSIX", but that case is reachable with
      the user-facing SQL function pg_collation_actual_version().  Remove the
      assertion.
      d50e3b1f
    • Peter Eisentraut's avatar
      Fix test for error message change · 8cff66d3
      Peter Eisentraut authored
      fix for 6be725e7
      8cff66d3
    • Peter Geoghegan's avatar
      Improve nbtree README's LP_DEAD section. · 5a2f154a
      Peter Geoghegan authored
      The description of how LP_DEAD bit setting by index scans works
      following commit 2ed5b87f was rather unclear.  Clean that up a bit.
      
      Also refer to LP_DEAD bit setting within _bt_check_unique() at the start
      of the same section.  This mechanism may actually be more important than
      the generic kill_prior_tuple mechanism that the section focuses on, so
      it at least deserves to be mentioned in passing.
      5a2f154a
  5. 07 Nov, 2020 9 commits
  6. 06 Nov, 2020 6 commits
  7. 05 Nov, 2020 4 commits
    • Peter Geoghegan's avatar
      Fix wal_consistency_checking nbtree bug. · efc5dcfd
      Peter Geoghegan authored
      wal_consistency_checking indicated an inconsistency in certain cases
      involving nbtree page deletion.  The underlying issue is that there was
      a minor difference between the page image produced after a REDO routine
      ran and the corresponding page image following original execution.
      
      This harmless inconsistency has been around forever.  We more or less
      expect total consistency among even deleted nbtree pages these days,
      though, so this won't do anymore.
      
      To fix, tweak the REDO routine to match original execution.
      
      Oversight in commit f47b5e13.
      efc5dcfd
    • Tom Lane's avatar
      Don't throw an error for LOCK TABLE on a self-referential view. · 5b7bfc39
      Tom Lane authored
      LOCK TABLE has complained about "infinite recursion" when applied
      to a self-referential view, ever since we made it recurse into views
      in v11.  However, that breaks pg_dump's new assumption that it's
      okay to lock every relation.  There doesn't seem to be any good
      reason to throw an error: if we just abandon the recursion, we've
      still satisfied the requirement of locking every referenced relation.
      
      Per bug #16703 from Andrew Bille (via Alexander Lakhin).
      
      Discussion: https://postgr.es/m/16703-e348f58aab3cf6cc@postgresql.org
      5b7bfc39
    • Peter Geoghegan's avatar
      Fix nbtree cleanup-only VACUUM stats inaccuracies. · 48e12913
      Peter Geoghegan authored
      Logic for counting heap TIDs from posting list tuples (added by commit
      0d861bbb) was faulty.  It didn't count any TIDs/index tuples in the
      event of no callback being set.  This meant that we incorrectly counted
      no index tuples in clean-up only VACUUMs, which could lead to
      pg_class.reltuples being spuriously set to 0 in affected indexes.
      
      To fix, go back to counting items from the page in cases where there is
      no callback.  This approach isn't very accurate, but it works well
      enough in practice while avoiding the expense of accessing every index
      tuple during cleanup-only VACUUMs.
      
      Author: Peter Geoghegan <pg@bowt.ie>
      Reported-By: default avatarJehan-Guillaume de Rorthais <jgdr@dalibo.com>
      https://postgr.es/m/20201023174451.69e358f1@firost
      Backpatch: 13-, where nbtree deduplication was introduced
      48e12913
    • Thomas Munro's avatar
      Fix unlinking of SLRU segments. · c732c3f8
      Thomas Munro authored
      Commit dee663f7 intended to drop any queued up fsync requests before
      unlinking segment files, but missed a code path.  Fix, by centralizing
      the forget-and-unlink code into a single function.
      Reported-by: default avatarTomas Vondra <tomas.vondra@2ndquadrant.com>
      Discussion: https://postgr.es/m/20201104013205.icogbi773przyny5%40development
      c732c3f8
  8. 04 Nov, 2020 3 commits
    • Tom Lane's avatar
      Remove underflow error in float division with infinite divisor. · fac83dbd
      Tom Lane authored
      float4_div and float8_div correctly produced zero for zero divided
      by infinity, but threw an underflow error for nonzero finite values
      divided by infinity.  This seems wrong; at the very least it's
      inconsistent with the behavior recently implemented for numeric
      infinities.  Remove the error and allow zero to be returned.
      
      This patch also removes a useless isinf() test from the overflow
      checks in these functions (non-Inf divided by Inf can't produce Inf).
      
      Extracted from a larger patch; this seems significant outside the
      context of geometric operators, so it deserves its own commit.
      
      Kyotaro Horiguchi
      
      Discussion: https://postgr.es/m/CAGf+fX70rWFOk5cd00uMfa__0yP+vtQg5ck7c2Onb-Yczp0URA@mail.gmail.com
      fac83dbd
    • Tom Lane's avatar
      Declare assorted array functions using anycompatible not anyelement. · 9e38c2bb
      Tom Lane authored
      Convert array_append, array_prepend, array_cat, array_position,
      array_positions, array_remove, array_replace, and width_bucket
      to use anycompatiblearray.  This is a simple extension of commit
      5c292e6b to hit some other places where there's a pretty obvious
      gain in usability from doing so.
      
      Ideally we'd also modify other functions taking multiple old-style
      polymorphic arguments.  But most of the remainder are tied into one
      or more operator classes, making any such change a much larger can of
      worms than I desire to open right now.
      
      Discussion: https://postgr.es/m/77675130-89da-dab1-51dd-492c93dcf5d1@postgresfriends.org
      9e38c2bb
    • Tom Lane's avatar
      Declare lead() and lag() using anycompatible not anyelement. · 5c292e6b
      Tom Lane authored
      This allows use of a "default" expression that doesn't slavishly
      match the data column's type.  Formerly you got something like
      "function lag(numeric, integer, integer) does not exist", which
      is not just unhelpful but actively misleading.
      
      The SQL spec suggests that the default should be coerced to the data
      column's type, but this implementation instead chooses the common
      supertype, which seems at least as reasonable.
      
      (Note: I took the opportunity to run "make reformat-dat-files" on
      pg_proc.dat, so this commit includes some cosmetic changes to
      recently-added entries that aren't related to lead/lag.)
      
      Vik Fearing
      
      Discussion: https://postgr.es/m/77675130-89da-dab1-51dd-492c93dcf5d1@postgresfriends.org
      5c292e6b