1. 30 Apr, 2018 3 commits
    • Tom Lane's avatar
      Dump full memory maps around failing Windows reattach code. · 6ba0cc4b
      Tom Lane authored
      This morning's results from buildfarm member dory make it pretty
      clear that something is getting mapped into the just-freed space,
      but not what that something is.  Replace my minimalistic probes
      with a full dump of the process address space and module space,
      based on Noah's work at
      <20170403065106.GA2624300%40tornado.leadboat.com>
      
      This is all (probably) to get reverted once we have fixed the
      problem, but for now we need information.
      
      Discussion: https://postgr.es/m/25495.1524517820@sss.pgh.pa.us
      6ba0cc4b
    • Tom Lane's avatar
      Fix bogus list-iteration code in pg_regress.c, affecting ecpg tests only. · c5e46c7c
      Tom Lane authored
      While looking at a recent buildfarm failure in the ecpg tests, I wondered
      why the pg_regress output claimed the stderr part of the test failed, when
      the regression diffs were clearly for the stdout part.  Looking into it,
      the reason is that pg_regress.c's logic for iterating over three parallel
      lists is wrong, and has been wrong since it was written: it advances the
      "tag" pointer at a different place in the loop than the other two pointers.
      Fix that.
      c5e46c7c
    • Tom Lane's avatar
      Get still more info about Windows can't-reattach-to-shared-memory errors. · eb16011f
      Tom Lane authored
      After some thought about the info captured so far, it seems possible
      that MapViewOfFileEx is itself causing some DLL to get loaded into
      the space just freed by VirtualFree.  The previous commit here didn't
      capture enough info to really prove the case for that, so let's add
      one more VirtualQuery in between those steps.  Also, be sure to
      capture the post-Map state before we emit any log entries, just in
      case elog() is invoking some code not previously loaded.
      
      Discussion: https://postgr.es/m/25495.1524517820@sss.pgh.pa.us
      eb16011f
  2. 29 Apr, 2018 5 commits
    • Tom Lane's avatar
      Avoid wrong results for power() with NaN input on more platforms. · 6bdf1303
      Tom Lane authored
      Buildfarm results show that the modern POSIX rule that 1 ^ NaN = 1 is not
      honored on *BSD until relatively recently, and really old platforms don't
      believe that NaN ^ 0 = 1 either.  (This is unsurprising, perhaps, since
      SUSv2 doesn't require either behavior.)  In hopes of getting to platform
      independent behavior, let's deal with all the NaN-input cases explicitly
      in dpow().
      
      Note that numeric_power() doesn't know either of these special cases.
      But since that behavior is platform-independent, I think it should be
      addressed separately, and probably not back-patched.
      
      Discussion: https://postgr.es/m/75DB81BEEA95B445AE6D576A0A5C9E936A73E741@BPXM05GP.gisp.nec.co.jp
      6bdf1303
    • Tom Lane's avatar
      Get more info about Windows can't-reattach-to-shared-memory errors. · 68e7e973
      Tom Lane authored
      Commit 63ca350e neglected to probe the state of things *before*
      the VirtualFree call, which now looks like it might be interesting.
      
      Discussion: https://postgr.es/m/25495.1524517820@sss.pgh.pa.us
      68e7e973
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2018d. · df629586
      Tom Lane authored
      DST law changes in Palestine and Antarctica (Casey Station).  Historical
      corrections for Portugal and its colonies, as well as Enderbury, Jamaica,
      Turks & Caicos Islands, and Uruguay.
      df629586
    • Tom Lane's avatar
      Avoid wrong results for power() with NaN input on some platforms. · 61b200e2
      Tom Lane authored
      Per spec, the result of power() should be NaN if either input is NaN.
      It appears that on some versions of Windows, the libc function does
      return NaN, but it also sets errno = EDOM, confusing our code that
      attempts to work around shortcomings of other platforms.  Hence, add
      guard tests to avoid substituting a wrong result for the right one.
      
      It's been like this for a long time (and the odd behavior only appears
      in older MSVC releases, too) so back-patch to all supported branches.
      
      Dang Minh Huong, reviewed by David Rowley
      
      Discussion: https://postgr.es/m/75DB81BEEA95B445AE6D576A0A5C9E936A73E741@BPXM05GP.gisp.nec.co.jp
      61b200e2
    • Tom Lane's avatar
      Cosmetic improvement: use BKI_DEFAULT and BKI_LOOKUP in pg_language. · 85475afd
      Tom Lane authored
      The point of this is not really to remove redundancy in pg_language.dat;
      with only three entries, it's hardly worth it.  Rather, it is to get
      to a point where there are exactly zero hard-coded numeric pg_proc OID
      references in the catalog .dat files.  The lanvalidator column was the
      only remaining location of such references, and it seems like a good
      thing for future-proofing reasons to make it not be a special case.
      
      There are still a few places in the .dat files with numeric OID references
      to other catalogs, but after review I don't see any that seem worth
      changing at present.  In each case there are just too few entries to make
      it worth the trouble to create lookup infrastructure.
      
      This doesn't change the emitted postgres.bki file, so no catversion bump.
      85475afd
  3. 28 Apr, 2018 8 commits
  4. 27 Apr, 2018 5 commits
  5. 26 Apr, 2018 7 commits
  6. 25 Apr, 2018 9 commits
  7. 24 Apr, 2018 1 commit
  8. 23 Apr, 2018 2 commits
    • Alvaro Herrera's avatar
      Add GUC enable_partition_pruning · 055fb8d3
      Alvaro Herrera authored
      This controls both plan-time and execution-time new-style partition
      pruning.  While finer-grain control is possible (maybe using an enum GUC
      instead of boolean), there doesn't seem to be much need for that.
      
      This new parameter controls partition pruning for all queries:
      trivially, SELECT queries that affect partitioned tables are naturally
      under its control since they are using the new technology.  However,
      while UPDATE/DELETE queries do not use the new code, we make the new GUC
      control their behavior also (stealing control from
      constraint_exclusion), because it is more natural, and it leads to a
      more natural transition to the future in which those queries will also
      use the new pruning code.
      
      Constraint exclusion still controls pruning for regular inheritance
      situations (those not involving partitioned tables).
      
      Author: David Rowley
      Review: Amit Langote, Ashutosh Bapat, Justin Pryzby, David G. Johnston
      Discussion: https://postgr.es/m/CAKJS1f_0HwsxJG9m+nzU+CizxSdGtfe6iF_ykPYBiYft302DCw@mail.gmail.com
      055fb8d3
    • Tom Lane's avatar
      Fix handling of partition bounds for boolean partitioning columns. · 4df58f7e
      Tom Lane authored
      Previously, you could partition by a boolean column as long as you
      spelled the bound values as string literals, for instance FOR VALUES
      IN ('t').  The trouble with this is that ruleutils.c printed that as
      FOR VALUES IN (TRUE), which is reasonable syntax but wasn't accepted by
      the grammar.  That results in dump-and-reload failures for such cases.
      
      Apply a minimal fix that just causes TRUE and FALSE to be converted to
      strings 'true' and 'false'.  This is pretty grotty, but it's too late for
      a more principled fix in v11 (to say nothing of v10).  We should revisit
      the whole issue of how partition bound values are parsed for v12.
      
      Amit Langote
      
      Discussion: https://postgr.es/m/e05c5162-1103-7e37-d1ab-6de3e0afaf70@lab.ntt.co.jp
      4df58f7e