1. 19 Aug, 2017 2 commits
    • Tom Lane's avatar
      Fix possible core dump in parallel restore when using a TOC list. · b1c2d76a
      Tom Lane authored
      Commit 3eb9a5e7 unintentionally introduced an ordering dependency
      into restore_toc_entries_prefork().  The existing coding of
      reduce_dependencies() contains a check to skip moving a TOC entry
      to the ready_list if it wasn't initially in the pending_list.
      This used to suffice to prevent reduce_dependencies() from trying to
      move anything into the ready_list during restore_toc_entries_prefork(),
      because the pending_list stayed empty throughout that phase; but it no
      longer does.  The problem doesn't manifest unless the TOC has been
      reordered by SortTocFromFile, which is how I missed it in testing.
      
      To fix, just add a test for ready_list == NULL, converting the call
      with NULL from a poor man's sanity check into an explicit command
      not to touch TOC items' list membership.  Clarify some of the comments
      around this; in particular, note the primary purpose of the check for
      pending_list membership, which is to ensure that we can't try to restore
      the same item twice, in case a TOC list forces it to be restored before
      its dependency count goes to zero.
      
      Per report from Fabrízio de Royes Mello.  Back-patch to 9.3, like the
      previous commit.
      
      Discussion: https://postgr.es/m/CAFcNs+pjuv0JL_x4+=71TPUPjdLHOXA4YfT32myj_OrrZb4ohA@mail.gmail.com
      b1c2d76a
    • Peter Eisentraut's avatar
      Fix creation of ICU comments for keyword variants · 24620fc5
      Peter Eisentraut authored
      It would create the comment referring to the keyword-less parent
      locale.  This was broken in ddb5fdc0.
      24620fc5
  2. 18 Aug, 2017 1 commit
  3. 17 Aug, 2017 10 commits
  4. 16 Aug, 2017 14 commits
  5. 15 Aug, 2017 13 commits
    • Peter Eisentraut's avatar
      Include foreign tables in information_schema.table_privileges · 0659465c
      Peter Eisentraut authored
      This appears to have been an omission in the original commit
      0d692a0d.  All related information_schema views already include
      foreign tables.
      Reported-by: default avatarNicolas Thauvin <nicolas.thauvin@dalibo.com>
      0659465c
    • Peter Eisentraut's avatar
      psql: Add tab completion for \pset pager · 0f0ee68e
      Peter Eisentraut authored
      Author: Pavel Stehule <pavel.stehule@gmail.com>
      0f0ee68e
    • Alvaro Herrera's avatar
      Simplify autovacuum work-item implementation · 31ae1638
      Alvaro Herrera authored
      The initial implementation of autovacuum work-items used a dynamic
      shared memory area (DSA).  However, it's argued that dynamic shared
      memory is not portable enough, so we cannot rely on it being supported
      everywhere; at the same time, autovacuum work-items are now a critical
      part of the server, so it's not acceptable that they don't work in the
      cases where dynamic shared memory is disabled.  Therefore, let's fall
      back to a simpler implementation of work-items that just uses
      autovacuum's main shared memory segment for storage.
      
      Discussion: https://postgr.es/m/CA+TgmobQVbz4K_+RSmiM9HeRKpy3vS5xnbkL95gSEnWijzprKQ@mail.gmail.com
      31ae1638
    • Tom Lane's avatar
      Make simpler-simple-expressions code cope with a Gather plan. · b73f1b5c
      Tom Lane authored
      Commit 00418c61 expected that the plan generated for a simple-expression
      query would always be a plain Result node.  However, if force_parallel_mode
      is on, the planner might stick a Gather atop that.  Cope by looking through
      the Gather.  For safety, assert that the Gather's tlist is trivial.
      
      Per buildfarm.
      
      Discussion: https://postgr.es/m/23425.1502822098@sss.pgh.pa.us
      b73f1b5c
    • Peter Eisentraut's avatar
      Fix logical replication protocol comparison logic · 70b573b2
      Peter Eisentraut authored
      Since we currently only have one protocol, this doesn't make much of a
      difference other than the error message.
      
      Author: Yugo Nagata <nagata@sraoss.co.jp>
      70b573b2
    • Peter Eisentraut's avatar
      doc: Add missing logical replication protocol message · 34a23a34
      Peter Eisentraut authored
      Author: Masahiko Sawada <sawada.mshk@gmail.com>
      34a23a34
    • Peter Eisentraut's avatar
      Simplify some code in logical replication launcher · e42351ae
      Peter Eisentraut authored
      Avoid unnecessary locking calls when a subscription is disabled.
      
      Author: Yugo Nagata <nagata@sraoss.co.jp>
      e42351ae
    • Peter Eisentraut's avatar
      doc: Improve PDF bookmarks · 270fec9f
      Peter Eisentraut authored
      Also create PDF bookmarks/ToC entries for subsections of reference
      pages.  This was a regression from the previous jadetex-based build.
      Reported-by: default avatarErik Rijkers <er@xs4all.nl>
      270fec9f
    • Tom Lane's avatar
      Avoid out-of-memory in a hash join with many duplicate inner keys. · 4867d7f6
      Tom Lane authored
      The executor is capable of splitting buckets during a hash join if
      too much memory is being used by a small number of buckets.  However,
      this only helps if a bucket's population is actually divisible; if
      all the hash keys are alike, the tuples still end up in the same
      new bucket.  This can result in an OOM failure if there are enough
      inner keys with identical hash values.  The planner's cost estimates
      will bias it against choosing a hash join in such situations, but not
      by so much that it will never do so.  To mitigate the OOM hazard,
      explicitly estimate the hash bucket space needed by just the inner
      side's most common value, and if that would exceed work_mem then
      add disable_cost to the hash cost estimate.
      
      This approach doesn't account for the possibility that two or more
      common values would share the same hash value.  On the other hand,
      work_mem is normally a fairly conservative bound, so that eating
      two or more times that much space is probably not going to kill us.
      
      If we have no stats about the inner side, ignore this consideration.
      There was some discussion of making a conservative assumption, but that
      would effectively result in disabling hash join whenever we lack stats,
      which seems like an overreaction given how seldom the problem manifests
      in the field.
      
      Per a complaint from David Hinkle.  Although this could be viewed
      as a bug fix, the lack of similar complaints weighs against back-
      patching; indeed we waited for v11 because it seemed already rather
      late in the v10 cycle to be making plan choice changes like this one.
      
      Discussion: https://postgr.es/m/32013.1487271761@sss.pgh.pa.us
      4867d7f6
    • Alvaro Herrera's avatar
      Fix error handling path in autovacuum launcher · d9a622ce
      Alvaro Herrera authored
      The original code (since 00e6a16d) was assuming aborting the
      transaction in autovacuum launcher was sufficient to release all
      resources, but in reality the launcher runs quite a lot of code out of
      any transactions.  Re-introduce individual cleanup calls to make abort
      more robust.
      
      Reported-by: Robert Haas
      Discussion: https://postgr.es/m/CA+TgmobQVbz4K_+RSmiM9HeRKpy3vS5xnbkL95gSEnWijzprKQ@mail.gmail.com
      d9a622ce
    • Robert Haas's avatar
      Assorted preparatory refactoring for partition-wise join. · e139f195
      Robert Haas authored
      Instead of duplicating the logic to search for a matching
      ParamPathInfo in multiple places, factor it out into a separate
      function.
      
      Pass only the relevant bits of the PartitionKey to
      partition_bounds_equal instead of the whole thing, because
      partition-wise join will want to call this without having a
      PartitionKey available.
      
      Adjust allow_star_schema_join and calc_nestloop_required_outer
      to take relevant Relids rather than the entire Path, because
      partition-wise join will want to call it with the top-parent
      relids to determine whether a child join is allowable.
      
      Ashutosh Bapat.  Review and testing of the larger patch set of which
      this is a part by Amit Langote, Rajkumar Raghuwanshi, Rafia Sabih,
      Thomas Munro, Dilip Kumar, and me.
      
      Discussion: http://postgr.es/m/CA+TgmobQK80vtXjAsPZWWXd7c8u13G86gmuLupN+uUJjA+i4nA@mail.gmail.com
      e139f195
    • Tom Lane's avatar
      Simplify plpgsql's check for simple expressions. · 00418c61
      Tom Lane authored
      plpgsql wants to recognize expressions that it can execute directly
      via ExecEvalExpr() instead of going through the full SPI machinery.
      Originally the test for this consisted of recursively groveling through
      the post-planning expression tree to see if it contained only nodes that
      plpgsql recognized as safe.  That was a major maintenance headache, since
      it required updating plpgsql every time we added any kind of expression
      node.  It was also kind of expensive, so over time we added various
      pre-planning checks to try to short-circuit having to do that.
      Robert Haas pointed out that as of the SRF-processing changes in v10,
      particularly the addition of Query.hasTargetSRFs, there really isn't
      any reason to make the recursive scan at all: the initial checks cover
      everything we really care about.  We do have to make sure that those
      checks agree with what inline_function() considers, so that inlining
      of a function that formerly wasn't inlined can't cause an expression
      considered simple to become non-simple.
      
      Hence, delete the recursive function exec_simple_check_node(), and tweak
      those other tests to more exactly agree with inline_function().  Adjust
      some comments and function naming to match.
      
      Discussion: https://postgr.es/m/CA+TgmoZGZpwdEV2FQWaVxA_qZXsQE1DAS5Fu8fwxXDNvfndiUQ@mail.gmail.com
      00418c61
    • Michael Meskes's avatar
      a4619b26