1. 14 Sep, 2017 9 commits
  2. 13 Sep, 2017 8 commits
    • Tom Lane's avatar
      Adjust unstable regression test case. · 76e134fe
      Tom Lane authored
      Test queries added by commit 69835bc8 are giving unexpected results
      on some smaller buildfarm critters.  I think probably the seqscan
      logic is kicking in to cause the scans to not start at the beginning
      of the table.  Add ORDER BY to make them be indexscans instead.
      
      Per buildfarm member chipmunk.
      76e134fe
    • Tom Lane's avatar
      Update contrib/seg for new scalarlesel/scalargesel selectivity functions. · 44ba2920
      Tom Lane authored
      I somehow missed this module in commit 7d08ce28.
      44ba2920
    • Tom Lane's avatar
      Distinguish selectivity of < from <= and > from >=. · 7d08ce28
      Tom Lane authored
      Historically, the selectivity functions have simply not distinguished
      < from <=, or > from >=, arguing that the fraction of the population that
      satisfies the "=" aspect can be considered to be vanishingly small, if the
      comparison value isn't any of the most-common-values for the variable.
      (If it is, the code path that executes the operator against each MCV will
      take care of things properly.)  But that isn't really true unless we're
      dealing with a continuum of variable values, and in practice we seldom are.
      If "x = const" would estimate a nonzero number of rows for a given const
      value, then it follows that we ought to estimate different numbers of rows
      for "x < const" and "x <= const", even if the const is not one of the MCVs.
      Handling this more honestly makes a significant difference in edge cases,
      such as the estimate for a tight range (x BETWEEN y AND z where y and z
      are close together).
      
      Hence, split scalarltsel into scalarltsel/scalarlesel, and similarly
      split scalargtsel into scalargtsel/scalargesel.  Adjust <= and >=
      operator definitions to reference the new selectivity functions.
      Improve the core ineq_histogram_selectivity() function to make a
      correction for equality.  (Along the way, I learned quite a bit about
      exactly why that function gives good answers, which I tried to memorialize
      in improved comments.)
      
      The corresponding join selectivity functions were, and remain, just stubs.
      But I chose to split them similarly, to avoid confusion and to prevent the
      need for doing this exercise again if someone ever makes them less stubby.
      
      In passing, change ineq_histogram_selectivity's clamp for extreme
      probability estimates so that it varies depending on the histogram
      size, instead of being hardwired at 0.0001.  With the default histogram
      size of 100 entries, you still get the old clamp value, but bigger
      histograms should allow us to put more faith in edge values.
      
      Tom Lane, reviewed by Aleksander Alekseev and Kuntal Ghosh
      
      Discussion: https://postgr.es/m/12232.1499140410@sss.pgh.pa.us
      7d08ce28
    • Peter Eisentraut's avatar
      doc: Remove incorrect SCRAM protocol documentation · 089880ba
      Peter Eisentraut authored
      The documentation claimed that one should send
      "pg_same_as_startup_message" as the user name in the SCRAM messages, but
      this did not match the actual implementation, so remove it.
      089880ba
    • Bruce Momjian's avatar
      docs: adjust "link mode" mention in pg_upgrade streaming steps · 82e367dd
      Bruce Momjian authored
      Backpatch-through: 9.5
      82e367dd
    • Bruce Momjian's avatar
      docs: improve pg_upgrade standby instructions · 9521ce4a
      Bruce Momjian authored
      This makes it clear that pg_upgrade standby upgrade instructions should
      only be used in link mode, adds examples, and explains how rsync works
      with links.
      
      Reported-by: Andreas Joseph Krogh
      
      Discussion: https://postgr.es/m/VisenaEmail.6c.c0e592c5af4ef0a2.15e785dcb61@tc7-visena
      
      Backpatch-through: 9.5
      9521ce4a
    • Peter Eisentraut's avatar
      Improve error message in WAL sender · 61975d6c
      Peter Eisentraut authored
      The previous error message when attempting to run a general SQL command
      in a physical replication WAL sender was a bit sloppy.
      Reported-by: default avatarFujii Masao <masao.fujii@gmail.com>
      61975d6c
    • Peter Eisentraut's avatar
      Define LDAP_NO_ATTRS if necessary. · 1a2fdc99
      Peter Eisentraut authored
      Commit 83aaac41 introduced the use of
      LDAP_NO_ATTRS to avoid requesting a dummy attribute when doing search+bind
      LDAP authentication.  It turns out that not all LDAP implementations define
      that macro, but its value is fixed by the protocol so we can define it
      ourselves if it's missing.
      
      Author: Thomas Munro
      Reported-By: Ashutosh Sharma
      Discussion: https://postgr.es/m/CAE9k0Pm6FKCfPCiAr26-L_SMGOA7dT_k0%2B3pEbB8%2B-oT39xRpw%40mail.gmail.com
      1a2fdc99
  3. 12 Sep, 2017 8 commits
  4. 11 Sep, 2017 7 commits
  5. 10 Sep, 2017 3 commits
    • Tom Lane's avatar
      Quick-hack fix for foreign key cascade vs triggers with transition tables. · 3c435952
      Tom Lane authored
      AFTER triggers using transition tables crashed if they were fired due
      to a foreign key ON CASCADE update.  This is because ExecEndModifyTable
      flushes the transition tables, on the assumption that any trigger that
      could need them was already fired during ExecutorFinish.  Normally
      that's true, because we don't allow transition-table-using triggers
      to be deferred.  However, foreign key CASCADE updates force any
      triggers on the referencing table to be deferred to the outer query
      level, by means of the EXEC_FLAG_SKIP_TRIGGERS flag.  I don't recall
      all the details of why it's like that and am pretty loath to redesign
      it right now.  Instead, just teach ExecEndModifyTable to skip destroying
      the TransitionCaptureState when that flag is set.  This will allow the
      transition table data to survive until end of the current subtransaction.
      
      This isn't a terribly satisfactory solution, because (1) we might be
      leaking the transition tables for much longer than really necessary,
      and (2) as things stand, an AFTER STATEMENT trigger will fire once per
      RI updating query, ie once per row updated or deleted in the referenced
      table.  I suspect that is not per SQL spec.  But redesigning this is a
      research project that we're certainly not going to get done for v10.
      So let's go with this hackish answer for now.
      
      In passing, tweak AfterTriggerSaveEvent to not save the transition_capture
      pointer into the event record for a deferrable trigger.  This is not
      necessary to fix the current bug, but it avoids letting dangling pointers
      to long-gone transition tables persist in the trigger event queue.  That's
      at least a safety feature.  It might also allow merging shared trigger
      states in more cases than before.
      
      I added a regression test that demonstrates the crash on unpatched code,
      and also exposes the behavior of firing the AFTER STATEMENT triggers
      once per row update.
      
      Per bug #14808 from Philippe Beaudoin.  Back-patch to v10.
      
      Discussion: https://postgr.es/m/20170909064853.25630.12825@wrigleys.postgresql.org
      3c435952
    • Tom Lane's avatar
      Add a test harness for the red-black tree code. · 610bbdd8
      Tom Lane authored
      This improves the regression tests' coverage of rbtree.c from pretty
      awful (because some of the functions aren't used yet) to basically 100%.
      
      Victor Drobny, reviewed by Aleksander Alekseev and myself
      
      Discussion: https://postgr.es/m/c9d61310e16e75f8acaf6cb1c48b7b77@postgrespro.ru
      610bbdd8
    • Tom Lane's avatar
      Remove pre-order and post-order traversal logic for red-black trees. · f80e782a
      Tom Lane authored
      This code isn't used, and there's no clear reason why anybody would ever
      want to use it.  These traversal mechanisms don't yield a visitation order
      that is semantically meaningful for any external purpose, nor are they
      any faster or simpler than the left-to-right or right-to-left traversals.
      (In fact, some rough testing suggests they are slower :-(.)  Moreover,
      these mechanisms are impossible to test in any arm's-length fashion; doing
      so requires knowledge of the red-black tree's internal implementation.
      Hence, let's just jettison them.
      
      Discussion: https://postgr.es/m/17735.1505003111@sss.pgh.pa.us
      f80e782a
  6. 09 Sep, 2017 2 commits
    • Peter Eisentraut's avatar
      pg_upgrade: Message style fixes · c824c7e2
      Peter Eisentraut authored
      c824c7e2
    • Tom Lane's avatar
      Fix failure-to-copy bug in commit 6f6b99d1. · fdf87ed4
      Tom Lane authored
      The previous coding of get_qual_for_list() was careful to copy everything
      it was using from the input data structure.  The new version missed
      making a copy of pass-by-ref datum values that it's inserting into Consts.
      This is not optional, however, as revealed by buildfarm failures on
      machines running -DRELCACHE_FORCE_RELEASE: we're copying from a relcache
      entry that could go away before the required lifespan of our output
      expression.  I'm pretty sure -DCLOBBER_CACHE_ALWAYS machines won't like
      this either, but none of them have reported in yet.
      fdf87ed4
  7. 08 Sep, 2017 3 commits