1. 23 Dec, 2019 4 commits
  2. 22 Dec, 2019 2 commits
  3. 21 Dec, 2019 3 commits
    • Tom Lane's avatar
      In pgwin32_open, loop after ERROR_ACCESS_DENIED only if we can't stat. · 5406513e
      Tom Lane authored
      This fixes a performance problem introduced by commit 6d7547c2.
      ERROR_ACCESS_DENIED is returned in some other cases besides the
      delete-pending case considered by that commit; notably, if the
      given path names a directory instead of a plain file.  In that
      case we'll uselessly loop for 1 second before returning the
      failure condition.  That slows down some usage scenarios enough
      to cause test timeout failures on our Windows buildfarm critters.
      
      To fix, try to stat() the file, and sleep/loop only if that fails.
      It will fail in the delete-pending case, and also in the case where
      the deletion completed before we could stat(), so we have the cases
      where we want to loop covered.  In the directory case, the stat()
      should succeed, letting us exit without a wait.
      
      One case where we'll still wait uselessly is if the access-denied
      problem pertains to a directory in the given pathname.  But we don't
      expect that to happen in any performance-critical code path.
      
      There might be room to refine this further, but I'll push it now
      in hopes of making the buildfarm green again.
      
      Back-patch, like the preceding commit.
      
      Alexander Lakhin and Tom Lane
      
      Discussion: https://postgr.es/m/23073.1576626626@sss.pgh.pa.us
      5406513e
    • Bruce Momjian's avatar
      C comment: clarify why psql's help/exit/quit must alone · 4376fdba
      Bruce Momjian authored
      Document why no indentation and why no non-whitespace postfix is
      supported.
      
      Backpatch-through: master
      4376fdba
    • Bruce Momjian's avatar
      docs: clarify handling of column lists in COPY TO/FROM · 4cab43ec
      Bruce Momjian authored
      Previously it was unclear how COPY FROM handled cases where not all
      columns were specified, or if the order didn't match.
      
      Reported-by: pavlo.golub@gmail.com
      
      Discussion: https://postgr.es/m/157487729344.7213.14245726713444755296@wrigleys.postgresql.org
      
      Backpatch-through: 9.4
      4cab43ec
  4. 20 Dec, 2019 7 commits
  5. 19 Dec, 2019 9 commits
  6. 18 Dec, 2019 11 commits
  7. 17 Dec, 2019 4 commits
    • Tom Lane's avatar
      Fix error reporting for index expressions of prohibited types. · 2acab054
      Tom Lane authored
      If CheckAttributeType() threw an error about the datatype of an
      index expression column, it would report an empty column name,
      which is pretty unhelpful and certainly not the intended behavior.
      I (tgl) evidently broke this in commit cfc5008a, by not noticing
      that the column's attname was used above where I'd placed the
      assignment of it.
      
      In HEAD and v12, this is trivially fixable by moving up the
      assignment of attname.  Before v12 the code is a bit more messy;
      to avoid doing substantial refactoring, I took the lazy way out
      and just put in two copies of the assignment code.
      
      Report and patch by Amit Langote.  Back-patch to all supported
      branches.
      
      Discussion: https://postgr.es/m/CA+HiwqFA+BGyBFimjiYXXMa2Hc3fcL0+OJOyzUNjhU4NCa_XXw@mail.gmail.com
      2acab054
    • Robert Haas's avatar
      Fix bad formula in previous commit. · 5184f110
      Robert Haas authored
      Commit d5406dea used a slightly
      novel, and wrong, approach to compute the length of the last
      toast chunk. It worked fine unless the last chunk happened to
      have the largest possible size.
      5184f110
    • Robert Haas's avatar
      Code cleanup for toast_fetch_datum and toast_fetch_datum_slice. · d5406dea
      Robert Haas authored
      Rework some of the checks for bad TOAST chunks to be a bit simpler
      and easier to understand. These checks verify that (1) we get all
      and only the chunk numbers we expect to see and (2) each chunk has
      the expected size. However, the existing code was a bit hard to
      understand, at least for me; try to make it clearer.
      
      As part of that, have toast_fetch_datum_slice check the relationship
      between endchunk and totalchunks only with an Assert() rather than
      checking every chunk number against both values. There's no need to
      check that relationship in production builds because it's not a
      function of whether on-disk corruption is present; it's just a
      question of whether the code does the right math.
      
      Also, have toast_fetch_datum_slice() use ereport(ERROR) rather than
      elog(ERROR). Commit fd6ec93b made
      the two functions inconsistent with each other.
      
      Rename assorted variables for better clarity and consistency, and
      move assorted variables from function scope to the function's main
      loop. Remove a few variables that are used only once entirely.
      
      Patch by me, reviewed by Peter Eisentraut.
      
      Discussion: http://postgr.es/m/CA+TgmobBzxwFojJ0zV0Own3dr09y43hp+OzU2VW+nos4PMXWEg@mail.gmail.com
      d5406dea
    • Robert Haas's avatar
      simplehash: Allow for use in frontend code. · da41d710
      Robert Haas authored
      Commit 48995040 removed the largest
      barrier to use of simplehash in frontend code, but there's one more
      problem: it uses elog(ERROR, ...) or elog(LOG, ...) in a couple of
      places. Work around that by changing those to pg_log_error() and
      pg_log_info() when FRONTEND is defined.
      
      Patch by me, reviewed by Andres Freund.
      
      Discussion: http://postgr.es/m/CA+Tgmob8oyh02NrZW=xCScB+5GyJ-jVowE3+TWTUmPF=FsGWTA@mail.gmail.com
      da41d710