1. 17 Oct, 2020 3 commits
  2. 16 Oct, 2020 5 commits
  3. 15 Oct, 2020 16 commits
  4. 14 Oct, 2020 6 commits
  5. 13 Oct, 2020 5 commits
    • Tom Lane's avatar
      Paper over regression failures in infinite_recurse() on PPC64 Linux. · ae0f7b11
      Tom Lane authored
      Our infinite_recurse() test to verify sane stack-overrun behavior
      is affected by a bug of the Linux kernel on PPC64: it will get SIGSEGV
      if it receives a signal when the stack depth is (a) over 1MB and
      (b) within a few kB of filling the current physical stack allocation.
      See https://bugzilla.kernel.org/show_bug.cgi?id=205183.
      
      Since this test is a bit time-consuming and we run it in parallel with
      test scripts that do a lot of DDL, it can be expected to get an sinval
      catchup interrupt at some point, leading to failure if the timing is
      wrong.  This has caused more than 100 buildfarm failures over the
      past year or so.
      
      While a fix exists for the kernel bug, it might be years before that
      propagates into all production kernels, particularly in some of the
      older distros we have in the buildfarm.  For now, let's just back off
      and not run this test on Linux PPC64; that loses nothing in test
      coverage so far as our own code is concerned.
      
      To do that, split this test into a new script infinite_recurse.sql
      and skip the test when the platform name is powerpc64...-linux-gnu.
      
      Back-patch to v12.  Branches before that have not been seen to get
      this failure.  No doubt that's because the "errors" test was not
      run in parallel with other tests before commit 798070ec, greatly
      reducing the odds of an sinval catchup being necessary.
      
      I also back-patched 3c855354 into v12, just so the new regression
      script would look the same in all branches having it.
      
      Discussion: https://postgr.es/m/3479046.1602607848@sss.pgh.pa.us
      Discussion: https://postgr.es/m/20190723162703.GM22387%40telsasoft.com
      ae0f7b11
    • Heikki Linnakangas's avatar
      Create ResultRelInfos later in InitPlan, index them by RT index. · 1375422c
      Heikki Linnakangas authored
      Instead of allocating all the ResultRelInfos upfront in one big array,
      allocate them in ExecInitModifyTable(). es_result_relations is now an
      array of ResultRelInfo pointers, rather than an array of structs, and it
      is indexed by the RT index.
      
      This simplifies things: we get rid of the separate concept of a "result
      rel index", and don't need to set it in setrefs.c anymore. This also
      allows follow-up optimizations (not included in this commit yet) to skip
      initializing ResultRelInfos for target relations that were not needed at
      runtime, and removal of the es_result_relation_info pointer.
      
      The EState arrays of regular result rels and root result rels are merged
      into one array. Similarly, the resultRelations and rootResultRelations
      lists in PlannedStmt are merged into one. It's not actually clear to me
      why they were kept separate in the first place, but now that the
      es_result_relations array is indexed by RT index, it certainly seems
      pointless.
      
      The PlannedStmt->resultRelations list is now only needed for
      ExecRelationIsTargetRelation(). One visible effect of this change is that
      ExecRelationIsTargetRelation() will now return 'true' also for the
      partition root, if a partitioned table is updated. That seems like a good
      thing, although the function isn't used in core code, and I don't see any
      reason for an FDW to call it on a partition root.
      
      Author: Amit Langote
      Discussion: https://www.postgresql.org/message-id/CA%2BHiwqGEmiib8FLiHMhKB%2BCH5dRgHSLc5N5wnvc4kym%2BZYpQEQ%40mail.gmail.com
      1375422c
    • Amit Kapila's avatar
      Fix the unstable output of tests added by commit 8fccf758. · 2050832d
      Amit Kapila authored
      The test cases added by that commit were trying to test the exact number of
      times a particular transaction has spilled. However, that number can vary if
      any background transaction (say by autovacuum) happens in parallel to the main
      transaction. So let's not try to verify the exact count.
      
      Author: Amit Kapila
      Reviewed-by: Sawada Masahiko
      Discussion: https://postgr.es/m/CA+fd4k5_pPAYRTDrO2PbtTOe0eHQpBvuqmCr8ic39uTNmR49Eg@mail.gmail.com
      2050832d
    • Peter Eisentraut's avatar
      doc: Expand recursive query documentation · 323ae003
      Peter Eisentraut authored
      Break the section up with subsection headings.  Add examples for depth-
      and breadth-first search ordering.  For consistency with the SQL
      search clause, start the depth counting at 0 instead of 1 in the
      examples.
      
      Discussion: https://www.postgresql.org/message-id/c5603982-0088-7f14-0caa-fdcd0c837b57@2ndquadrant.com
      323ae003
    • Amit Kapila's avatar
      Add tests for logical replication spilled stats. · 8fccf758
      Amit Kapila authored
      Commit 98681675 added a mechanism to track statistics corresponding to
      the spilling of changes from ReorderBuffer but didn't add any tests.
      
      Author: Amit Kapila and Sawada Masahiko
      Discussion: https://postgr.es/m/CA+fd4k5_pPAYRTDrO2PbtTOe0eHQpBvuqmCr8ic39uTNmR49Eg@mail.gmail.com
      8fccf758
  6. 12 Oct, 2020 5 commits
    • Tom Lane's avatar
      Fix GiST buffering build to work when there are included columns. · 371668a8
      Tom Lane authored
      gistRelocateBuildBuffersOnSplit did not get the memo about which
      attribute count to use.  This could lead to a crash if there were
      included columns and buffering build was chosen.  (Because there
      are random page-split decisions elsewhere in GiST index build,
      the crashes are not entirely deterministic.)
      
      Back-patch to v12 where GiST gained support for included columns.
      
      Pavel Borisov
      
      Discussion: https://postgr.es/m/CALT9ZEECCV5m7wvxg46PC-7x-EybUmnpupBGhSFMoAAay+r6HQ@mail.gmail.com
      371668a8
    • Tom Lane's avatar
      Re-allow testing of GiST buffered builds. · 78c0b6ed
      Tom Lane authored
      Commit 16fa9b2b broke the ability to reliably test GiST buffered builds,
      because it caused sorted builds to be done instead if sortsupport is
      available, regardless of any attempt to override that.  While a would-be
      test case could try to work around that by choosing an opclass that has
      no sortsupport function, coverage would be silently lost the moment
      someone decides it'd be a good idea to add a sortsupport function.
      
      Hence, rearrange the logic in gistbuild() so that if "buffering = on"
      is specified in CREATE INDEX, we will use that method, sortsupport or no.
      
      Also document the interaction between sorting and the buffering
      parameter, as 16fa9b2b failed to do.
      
      (Note that in fact we still lack any test coverage of buffered builds,
      but this is a prerequisite to adding a non-fragile test.)
      
      Discussion: https://postgr.es/m/3249980.1602532990@sss.pgh.pa.us
      78c0b6ed
    • Tom Lane's avatar
      Fix memory leak when guc.c decides a setting can't be applied now. · 397ea901
      Tom Lane authored
      The prohibitValueChange code paths in set_config_option(), which
      are executed whenever we re-read a PGC_POSTMASTER variable from
      postgresql.conf, neglected to free anything before exiting.  Thus
      we'd leak the proposed new value of a PGC_STRING variable, as noted
      by BoChen in bug #16666.  For all variable types, if the check hook
      creates an "extra" chunk, we'd also leak that.
      
      These are malloc not palloc chunks, so there is no mechanism for
      recovering the leaks before process exit.  Fortunately, the values
      are typically not very large, meaning you'd have to go through an
      awful lot of SIGHUP configuration-reload cycles to make the leakage
      amount to anything.  Still, for a long-lived postmaster process it
      could potentially be a problem.
      
      Oversight in commit 2594cf0e.  Back-patch to all supported branches.
      
      Discussion: https://postgr.es/m/16666-2c41a4eec61b03e1@postgresql.org
      397ea901
    • Tom Lane's avatar
      Minor cleanup for win32stat.c. · fcd11329
      Tom Lane authored
      Use GetLastError(), rather than assuming that CreateFile() failure
      must map to ENOENT.  Noted by Michael Paquier.
      
      Discussion: https://postgr.es/m/CAC+AXB0g44SbvSpC86o_1HWh8TAU2pZrMRW6tJT-dkijotx5Qg@mail.gmail.com
      fcd11329
    • Michael Paquier's avatar
      Fix compilation warning in unicode_norm.c · e578c17d
      Michael Paquier authored
      80f8eb79 has introduced in unicode_norm.c some new code that uses
      htonl().  On at least some FreeBSD environments, it is possible to find
      that this function is undeclared, causing a compilation warning.  It is
      worth noting that no buildfarm members have reported this issue.
      
      Instead of adding a new inclusion to arpa/inet.h, switch to use
      the equivalent defined in pg_bswap.h, to benefit from any built-in
      function if the compiler has one.
      
      Reported-by: Masahiko Sawada
      Discussion: https://postgr.es/m/CA+fd4k7D4b12ShywWj=AbcHZzV1-OqMjNe7RZAu+tgz5rd_11A@mail.gmail.com
      e578c17d