1. 25 Jan, 2019 1 commit
  2. 24 Jan, 2019 10 commits
    • Tom Lane's avatar
      Remove _configthreadlocale() calls in ecpg test suite. · e3565fd6
      Tom Lane authored
      This essentially reverts commits a772624b and 04fbe0e4, which
      added "_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)" calls to the
      thread-related ecpg test programs.  That was nothing but a hack,
      because we shouldn't expect that ecpg-using applications have
      done that for us; and now that we've inserted such calls into
      ecpglib, the tests should still pass without it.
      
      (If they don't, it would be good to know that.)
      
      HEAD only; there seems no big need to change this in the
      back branches.
      
      Discussion: https://postgr.es/m/22937.1548307384@sss.pgh.pa.us
      e3565fd6
    • Tom Lane's avatar
      Remove infinite-loop hazards in ecpg test suite. · d5a1fde3
      Tom Lane authored
      A report from Andrew Dunstan showed that an ecpglib breakage that
      causes repeated query failures could lead to infinite loops in some
      ecpg test scripts, because they contain "while(1)" loops with no
      exit condition other than successful test completion.  That might
      be all right for manual testing, but it seems entirely unacceptable
      for automated test environments such as our buildfarm.  We don't
      want buildfarm owners to have to intervene manually when a test
      goes wrong.
      
      To fix, just change all those while(1) loops to exit after at most
      100 iterations (which is more than any of them expect to iterate).
      This seems sufficient since we'd see discrepancies in the test output
      if any loop executed the wrong number of times.
      
      I tested this by dint of intentionally breaking ecpg_do_prologue
      to always fail, and verifying that the tests still got to completion.
      
      Back-patch to all supported branches, since the whole point of this
      exercise is to protect the buildfarm against future mistakes.
      
      Discussion: https://postgr.es/m/18693.1548302004@sss.pgh.pa.us
      d5a1fde3
    • Peter Eisentraut's avatar
      PL/pgSQL: Add statement ID to statement structures · bbd5c207
      Peter Eisentraut authored
      This can be used by a profiler as the index for an array of
      per-statement metrics.
      
      Author: Pavel Stehule <pavel.stehule@gmail.com>
      Reviewed-by: default avatarPeter Eisentraut <peter.eisentraut@2ndquadrant.com>
      Discussion: https://www.postgresql.org/message-id/flat/CAFj8pRDRCjN6rpM9ZccU7Ta_afsNX7mg9=n34F+r445Nt9v2tA@mail.gmail.com/
      bbd5c207
    • Peter Eisentraut's avatar
      Fix whitespace · bf2fb2e0
      Peter Eisentraut authored
      bf2fb2e0
    • Alvaro Herrera's avatar
      Fix droppability of constraints upon partition detach · efd9366d
      Alvaro Herrera authored
      We were failing to set conislocal correctly for constraints in
      partitions after partition detach, leading to those constraints becoming
      undroppable.  Fix by setting the flag correctly.  Existing databases
      might contain constraints with the conislocal wrongly set to false, for
      partitions that were detached; this situation should be fixable by
      applying an UPDATE on pg_constraint to set conislocal true.  This
      problem should otherwise be innocuous and should disappear across a
      dump/restore or pg_upgrade.
      
      Secondarily, when constraint drop was attempted in a partitioned table,
      ATExecDropConstraint would try to recurse to partitions after doing
      performDeletion() of the constraint in the partitioned table itself; but
      since the constraint in the partitions are dropped by the initial call
      of performDeletion() (because of following dependencies), the recursion
      step would fail since it would not find the constraint, causing the
      whole operation to fail.  Fix by preventing recursion.
      
      Reported-by: Amit Langote
      Diagnosed-by: Amit Langote
      Author: Amit Langote, Álvaro Herrera
      Discussion: https://postgr.es/m/f2b8ead5-4131-d5a8-8016-2ea0a31250af@lab.ntt.co.jp
      efd9366d
    • Tom Lane's avatar
      Fix portability problem in pgbench. · e6c3ba7f
      Tom Lane authored
      The pgbench regression test supposed that srandom() with a specific value
      would result in deterministic output from random(), as required by POSIX.
      It emerges however that OpenBSD is too smart to be constrained by mere
      standards, so their random() emits nondeterministic output anyway.
      While a workaround does exist, what seems like a better fix is to stop
      relying on the platform's srandom()/random() altogether, so that what
      you get from --random-seed=N is not merely deterministic but platform
      independent.  Hence, use a separate pg_jrand48() random sequence in
      place of random().
      
      Also adjust the regression test case that's supposed to detect
      nondeterminism so that it's more likely to detect it; the original
      choice of random_zipfian parameter tended to produce the same output
      all the time even if the underlying behavior wasn't deterministic.
      
      In passing, improve pgbench's docs about random_zipfian().
      
      Back-patch to v11 where this code was introduced.
      
      Fabien Coelho and Tom Lane
      
      Discussion: https://postgr.es/m/4615.1547792324@sss.pgh.pa.us
      e6c3ba7f
    • Alvaro Herrera's avatar
      Simplify coding to detach constraints when detaching partition · 19184fcc
      Alvaro Herrera authored
      The original coding was too baroque and led to an use-after-release
      mistake, noticed by buildfarm member prion.
      
      Discussion: https://postgr.es/m/21693.1548305934@sss.pgh.pa.us
      19184fcc
    • Etsuro Fujita's avatar
      postgres_fdw: Account for tlist eval costs in estimate_path_cost_size(). · fd1afdba
      Etsuro Fujita authored
      Previously, estimate_path_cost_size() didn't account for tlist eval
      costs, except when costing a foreign-grouping path using local
      statistics, but such costs should be accounted for when costing that path
      using remote estimates, because some of the tlist expressions might be
      evaluated locally.  Also, such costs should be accounted for in the case
      of a foreign-scan or foreign-join path, because the tlist might contain
      PlaceHolderVars, which postgres_fdw currently evaluates locally.
      
      This also fixes an oversight in my commit f8f6e446.
      
      Like that commit, apply this to HEAD only to avoid destabilizing existing
      plan choices.
      
      Author: Etsuro Fujita
      Discussion: https://postgr.es/m/5BFD3EAD.2060301%40lab.ntt.co.jp
      fd1afdba
    • Tom Lane's avatar
      Blind attempt to fix _configthreadlocale() failures on MinGW. · 2cf91ccb
      Tom Lane authored
      Apparently, some builds of MinGW contain a version of
      _configthreadlocale() that always returns -1, indicating failure.
      Rather than treating that as a curl-up-and-die condition, soldier on
      as though the function didn't exist.  This leaves us without thread
      safety on such MinGW versions, but we didn't have it anyway.
      
      Discussion: https://postgr.es/m/d06a16bc-52d6-9f0d-2379-21242d7dbe81@2ndQuadrant.com
      2cf91ccb
    • Alvaro Herrera's avatar
      Detach constraints when partitions are detached · ae366aa5
      Alvaro Herrera authored
      I (Álvaro) forgot to do this in eb7ed3f3, leading to undroppable
      constraints after partitions are detached.  Repair.
      
      Reported-by: Amit Langote
      Author: Amit Langote
      Discussion: https://postgr.es/m/c1c9b688-b886-84f7-4048-1e4ebe9b1d06@lab.ntt.co.jp
      ae366aa5
  3. 23 Jan, 2019 5 commits
  4. 22 Jan, 2019 8 commits
  5. 21 Jan, 2019 16 commits