1. 01 Mar, 2019 8 commits
    • Tom Lane's avatar
      Teach optimizer's predtest.c more things about ScalarArrayOpExpr. · 65ce07e0
      Tom Lane authored
      In particular, make it possible to prove/refute "x IS NULL" and
      "x IS NOT NULL" predicates from a clause involving a ScalarArrayOpExpr
      even when we are unable or unwilling to deconstruct the expression
      into an AND/OR tree.  This avoids a former unexpected degradation of
      plan quality when the size of an ARRAY[] expression or array constant
      exceeded the arbitrary MAX_SAOP_ARRAY_SIZE limit.  For IS-NULL proofs,
      we don't really care about the values of the individual array elements;
      at most, we care whether there are any, and for some common cases we
      needn't even know that.
      
      The main user-visible effect of this is to let the optimizer recognize
      applicability of partial indexes with "x IS NOT NULL" predicates to
      queries with "x IN (array)" clauses in some cases where it previously
      failed to recognize that.  The structure of predtest.c is such that a
      bunch of related proofs will now also succeed, but they're probably
      much less useful in the wild.
      
      James Coleman, reviewed by David Rowley
      
      Discussion: https://postgr.es/m/CAAaqYe8yKSvzbyu8w-dThRs9aTFMwrFxn_BkTYeXgjqe3CbNjg@mail.gmail.com
      65ce07e0
    • Peter Eisentraut's avatar
      Fix whitespace · aad21d4c
      Peter Eisentraut authored
      aad21d4c
    • Andrew Dunstan's avatar
      Remove tests for pg_dumpall --exclude-database missing argument · 97b6f2eb
      Andrew Dunstan authored
      It turns out that different getopt implementations spell the error for
      missing arguments different ways. This test is of fairly marginal
      value, so instead of trying to keep up  with the different error
      messages just remove the test.
      97b6f2eb
    • Andres Freund's avatar
      Store tuples for EvalPlanQual in slots, rather than as HeapTuples. · ad0bda5d
      Andres Freund authored
      For the upcoming pluggable table access methods it's quite
      inconvenient to store tuples as HeapTuples, as that'd require
      converting tuples from a their native format into HeapTuples. Instead
      use slots to manage epq tuples.
      
      To fit into that scheme, change the foreign data wrapper callback
      RefetchForeignRow, to store the tuple in a slot. Insist on using the
      caller provided slot, so it conveniently can be stored in the
      corresponding EPQ slot.  As there is no in core user of
      RefetchForeignRow, that change was done blindly, but we plan to test
      that soon.
      
      To avoid duplicating that work for row locks, move row locks to just
      directly use the EPQ slots - it previously temporarily stored tuples
      in LockRowsState.lr_curtuples, but that doesn't seem beneficial, given
      we'd possibly end up with a significant number of additional slots.
      
      The behaviour of es_epqTupleSet[rti -1] is now checked by
      es_epqTupleSlot[rti -1] != NULL, as that is distinguishable from a
      slot containing an empty tuple.
      
      Author: Andres Freund, Haribabu Kommi, Ashutosh Bapat
      Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
      ad0bda5d
    • Andrew Dunstan's avatar
      Add extra descriptive headings in pg_dumpall · 6cbdbd9e
      Andrew Dunstan authored
      Headings are added for the User Configurations and Databases sections,
      and for each user configuration and database in the output.
      
      Author: Fabien Coelho
      Discussion: https://postgr.es/m/alpine.DEB.2.21.1812272222130.32444@lancre
      6cbdbd9e
    • Andrew Dunstan's avatar
      Add --exclude-database option to pg_dumpall · f092de05
      Andrew Dunstan authored
      This option functions similarly to pg_dump's --exclude-table option, but
      for database names. The option can be given once, and the argument can
      be a pattern including wildcard characters.
      
      Author: Andrew Dunstan.
      Reviewd-by: Fabien Coelho and Michael Paquier
      Discussion: https://postgr.es/m/43a54a47-4aa7-c70e-9ca6-648f436dd6e6@2ndQuadrant.com
      f092de05
    • Amit Kapila's avatar
      Clear the local map when not used. · 9c32e4c3
      Amit Kapila authored
      After commit b0eaa4c5, we use a local map of pages to find the required
      space for small relations.  We do clear this map when we have found a block
      with enough free space, when we extend the relation, or on transaction
      abort so that it can be used next time.  However, we miss to clear it when
      we didn't find any pages to try from the map which leads to an assertion
      failure when we later tried to use it after relation extension.
      
      In the passing, I have improved some comments in this area.
      
      Reported-by: Tom Lane based on buildfarm results
      Author: Amit Kapila
      Reviewed-by: John Naylor
      Tested-by: Kuntal Ghosh
      Discussion: https://postgr.es/m/32368.1551114120@sss.pgh.pa.us
      9c32e4c3
    • Michael Paquier's avatar
      Make pg_partition_tree return no rows on unsupported and undefined objects · 0f3cdf87
      Michael Paquier authored
      The function was tweaked so as it returned one row full of NULLs when
      working on an unsupported relkind or an undefined object as of cc53123b,
      and after discussion with Amit and Álvaro it looks more natural to make
      it return no rows.
      
      Author: Michael Paquier
      Reviewed-by: Álvaro Herrera, Amit Langote
      Discussion: https://postgr.es/m/20190227184808.GA17357@alvherre.pgsql
      0f3cdf87
  2. 28 Feb, 2019 15 commits
  3. 27 Feb, 2019 9 commits
  4. 26 Feb, 2019 6 commits
    • Robert Haas's avatar
      Change lock acquisition order in expand_inherited_rtentry. · f4b6341d
      Robert Haas authored
      Previously, this function acquired locks in the order using
      find_all_inheritors(), which locks the children of each table that it
      processes in ascending OID order, and which processes the inheritance
      hierarchy as a whole in a breadth-first fashion.  Now, it processes
      the inheritance hierarchy in a depth-first fashion, and at each level
      it proceeds in the order in which tables appear in the PartitionDesc.
      If table inheritance rather than table partitioning is used, the old
      order is preserved.
      
      This change moves the locking of any given partition much closer to
      the code that actually expands that partition.  This seems essential
      if we ever want to allow concurrent DDL to add or remove partitions,
      because if the set of partitions can change, we must use the same data
      to decide which partitions to lock as we do to decide which partitions
      to expand; otherwise, we might expand a partition that we haven't
      locked.  It should hopefully also facilitate efforts to postpone
      inheritance expansion or locking for performance reasons, because
      there's really no way to postpone locking some partitions if
      we're blindly locking them all using find_all_inheritors().
      
      The only downside of this change which is known to me is that it
      further deviates from the principle that we should always lock the
      inheritance hierarchy in find_all_inheritors() order to avoid deadlock
      risk.  However, we've already crossed that bridge in commit
      9eefba18 and there are futher patches
      pending that make similar changes, so this isn't really giving up
      anything that we haven't surrendered already -- and it seems entirely
      worth it, given the performance benefits some of those changes seem
      likely to bring.
      
      Patch by me; thanks to David Rowley for discussion of these issues.
      
      Discussion: http://postgr.es/m/CAKJS1f_eEYVEq5tM8sm1k-HOwG0AyCPwX54XG9x4w0zy_N4Q_Q@mail.gmail.com
      Discussion: http://postgr.es/m/CA+TgmoZUwPf_uanjF==gTGBMJrn8uCq52XYvAEorNkLrUdoawg@mail.gmail.com
      f4b6341d
    • Michael Meskes's avatar
      Free memory in ecpg bytea regression test. · 42ccbe43
      Michael Meskes authored
      While not really a problem it's easier to run tools like valgrind against it
      when fixed.
      42ccbe43
    • Michael Meskes's avatar
    • Michael Paquier's avatar
      Simplify some code in pg_rewind when syncing target directory · 6e52209e
      Michael Paquier authored
      9a4059d4 simplified the flush of target data folder when finishing
      processing, and could have done a bit more.
      
      Discussion: https://postgr.es/m/20190131064759.GA13429@paquier.xyz
      6e52209e
    • Peter Geoghegan's avatar
      Remove unneeded argument from _bt_getstackbuf(). · 2ab23445
      Peter Geoghegan authored
      _bt_getstackbuf() is called at exactly two points following commit
      efada2b8 (one call site is concerned with page splits, while the
      other is concerned with page deletion).  The parent buffer returned by
      _bt_getstackbuf() is write-locked in both cases.  Remove the 'access'
      argument and make _bt_getstackbuf() assume that callers require a
      write-lock.
      2ab23445
    • Peter Geoghegan's avatar
      Correct obsolete nbtree page deletion comment. · 067786ce
      Peter Geoghegan authored
      Commit efada2b8, which made the nbtree page deletion algorithm more
      robust, removed _bt_getstackbuf() calls from _bt_pagedel().  It failed
      to update a comment that referenced the earlier approach.  Update the
      comment to explain that the _bt_getstackbuf() page deletion call site
      mirrors the only other remaining _bt_getstackbuf() call site, which is
      reached during page splits.
      067786ce
  5. 25 Feb, 2019 2 commits