1. 26 Jul, 2018 1 commit
    • Tom Lane's avatar
      Avoid crash in eval_const_expressions if a Param's type changes. · 662d12ae
      Tom Lane authored
      Since commit 6719b238 it's been possible for the values of plpgsql
      record field variables to be exposed to the planner as Params.
      (Before that, plpgsql never supplied values for such variables during
      planning, so that the problematic code wasn't reached.)  Other places
      that touch potentially-type-mutable Params either cope gracefully or
      do runtime-test-and-ereport checks that the type is what they expect.
      But eval_const_expressions() just had an Assert, meaning that it either
      failed the assertion or risked crashes due to using an incompatible
      value.
      
      In this case, rather than throwing an ereport immediately, we can just
      not perform a const-substitution in case of a mismatch.  This seems
      important for the same reason that the Param fetch was speculative:
      we might not actually reach this part of the expression at runtime.
      
      Test case will follow in a separate commit.
      
      Patch by me, pursuant to bug report from Andrew Gierth.
      Back-patch to v11 where the previous commit appeared.
      
      Discussion: https://postgr.es/m/87wotkfju1.fsf@news-spur.riddles.org.uk
      662d12ae
  2. 25 Jul, 2018 2 commits
  3. 24 Jul, 2018 8 commits
  4. 23 Jul, 2018 8 commits
  5. 22 Jul, 2018 2 commits
  6. 21 Jul, 2018 2 commits
    • Tom Lane's avatar
      Further portability hacking in pg_upgrade's test script. · 04269320
      Tom Lane authored
      I blew the dust off a Bourne shell (file date 1996, yea verily) and
      tried to run test.sh with it.  It mostly worked, but I found that the
      temp-directory creation code introduced by commit be76a6d3 was not
      compatible, for a couple of reasons: this shell thinks "set -e" should
      force an exit if a command within backticks fails, and it also thinks code
      within braces should be executed by a sub-shell, meaning that variable
      settings don't propagate back up to the parent shell.  In view of Victor
      Wagner's report that Solaris is still using pre-POSIX shells, seems like
      we oughta make this case work.  It's not like the code is any less
      idiomatic this way; the prior coding technique appeared nowhere else.
      
      (There is a remaining bash-ism here, which is that $RANDOM doesn't do
      what the code hopes in non-bash shells.  But the use of $$ elsewhere in
      that path should be enough to ensure uniqueness and some amount of
      randomness, so I think it's okay as-is.)
      
      Back-patch to all supported branches, as the previous commit was.
      
      Discussion: https://postgr.es/m/20180720153820.69e9ae6c@fafnir.local.vm
      04269320
    • Tom Lane's avatar
      Be more paranoid about quoting in pg_upgrade's test script. · 0c0908d9
      Tom Lane authored
      Double-quote $PGDATA in "find" commands introduced by commit da9b580d,
      in case that path contains spaces or other special characters.
      
      Adjust a few other places so that quoting is done more consistently.
      None of the others are actual bugs AFAICS, but it's confusing to readers
      if the same thing is done differently in different places.
      
      Noted by Tels.
      
      Discussion: https://postgr.es/m/c96303c04c360bbedaa04f90f515745b.squirrel@sm.webmail.pair.com
      0c0908d9
  7. 20 Jul, 2018 3 commits
  8. 19 Jul, 2018 12 commits
  9. 18 Jul, 2018 2 commits
    • Tom Lane's avatar
      Remove race-prone hot_standby_feedback test cases in 001_stream_rep.pl. · a360f952
      Tom Lane authored
      This script supposed that if it turned hot_standby_feedback on and then
      shut down the standby server, at least one feedback message would be
      guaranteed to be sent before the standby stops.  But there is no such
      guarantee, if the standby's walreceiver process is slow enough --- and
      we've seen multiple failures in the buildfarm showing that that does
      happen in practice.  While we could rearrange the walreceiver logic to
      make it less likely, it seems probably impossible to create a really
      bulletproof guarantee of that sort; and if we tried, we might create
      situations where the walreceiver wouldn't react in a timely manner to
      shutdown commands.  It seems better instead to remove the script's
      assumption that feedback will occur before shutdown.
      
      But once we do that, these last few tests seem quite redundant with
      the earlier tests in the script.  So let's just drop them altogether
      and save some buildfarm cycles.
      
      Backpatch to v10 where these tests were added.
      
      Discussion: https://postgr.es/m/1922.1531592205@sss.pgh.pa.us
      a360f952
    • Tom Lane's avatar
      Drop the rule against included index columns duplicating key columns. · 701fd0bb
      Tom Lane authored
      The initial version of the included-index-column feature stated that
      included columns couldn't be the same as any key column of the index.
      While it'd be pretty silly to do that, since the included column would be
      entirely redundant, we've never prohibited redundant index columns before
      so it's not very consistent to do so here.  Moreover, the prohibition
      was itself badly implemented, so that it failed to reject columns that
      were effectively identical but not spelled quite alike, as reported by
      Aditya Toshniwal.
      
      (Moreover, it's not hard to imagine that for some non-btree index types,
      such cases would be non-silly anyhow: the index might use a lossy
      representation for key columns but be able to support retrieval of the
      original form of included columns.)
      
      Hence, let's just drop the prohibition.
      
      In passing, do some copy-editing on the documentation for the
      included-column feature.
      
      Yugo Nagata; documentation and test corrections by me
      
      Discussion: https://postgr.es/m/CAM9w-_mhBCys4fQNfaiQKTRrVWtoFrZ-wXmDuE9Nj5y-Y7aDKQ@mail.gmail.com
      701fd0bb