1. 07 Mar, 2019 1 commit
  2. 06 Mar, 2019 12 commits
  3. 05 Mar, 2019 4 commits
  4. 04 Mar, 2019 9 commits
  5. 03 Mar, 2019 4 commits
    • Andrew Dunstan's avatar
      Don't do pg_ctl logrotate test on Windows · d611175e
      Andrew Dunstan authored
      The test crashes and burns quite badly, for some reason, but even if it
      didn't it wouldn't work, since Windows doesn't let you rename a file
      held by a running process.
      d611175e
    • Tom Lane's avatar
      Improve performance of index-only scans with many index columns. · 80b9e9c4
      Tom Lane authored
      StoreIndexTuple was a loop over index_getattr, which is O(N^2)
      if the index columns are variable-width, and the performance
      impact is already quite visible at ten columns.  The obvious
      move is to replace that with a call to index_deform_tuple ...
      but that's *also* a loop over index_getattr.  Improve it to
      be essentially a clone of heap_deform_tuple.
      
      (There are a few other places that loop over all index columns
      with index_getattr, and perhaps should be changed likewise,
      but most of them don't seem performance-critical.  Anyway, the
      rest would mostly only be interested in the index key columns,
      which there aren't likely to be so many of.  Wide index tuples
      are a new thing with INCLUDE.)
      
      Konstantin Knizhnik
      
      Discussion: https://postgr.es/m/e06b2d27-04fc-5c0e-bb8c-ecd72aa24959@postgrespro.ru
      80b9e9c4
    • Andrew Dunstan's avatar
      Avoid accidental wildcard expansion in msys shell · 78b408a2
      Andrew Dunstan authored
      Commit f092de05 added a test for pg_dumpall --exclude-database including
      the wildcard pattern '*dump*' which matches some files in the source
      directory. The test library on msys uses the shell which expands this
      and thus the program gets incorrect arguments. This doesn't happen if
      the pattern doesn't match any files, so here the pattern is set to
      '*dump_test*' which is such a pattern.
      
      Per buildfarm animal jacana.
      78b408a2
    • Dean Rasheed's avatar
      Further fixing for multi-row VALUES lists for updatable views. · ed4653db
      Dean Rasheed authored
      Previously, rewriteTargetListIU() generated a list of attribute
      numbers from the targetlist, which were passed to rewriteValuesRTE(),
      which expected them to contain the same number of entries as there are
      columns in the VALUES RTE, and to be in the same order. That was fine
      when the target relation was a table, but for an updatable view it
      could be broken in at least three different ways ---
      rewriteTargetListIU() could insert additional targetlist entries for
      view columns with defaults, the view columns could be in a different
      order from the columns of the underlying base relation, and targetlist
      entries could be merged together when assigning to elements of an
      array or composite type. As a result, when recursing to the base
      relation, the list of attribute numbers generated from the rewritten
      targetlist could no longer be relied upon to match the columns of the
      VALUES RTE. We got away with that prior to 41531e42 because it used
      to always be the case that rewriteValuesRTE() did nothing for the
      underlying base relation, since all DEFAULTS had already been replaced
      when it was initially invoked for the view, but that was incorrect
      because it failed to apply defaults from the base relation.
      
      Fix this by examining the targetlist entries more carefully and
      picking out just those that are simple Vars referencing the VALUES
      RTE. That's sufficient for the purposes of rewriteValuesRTE(), which
      is only responsible for dealing with DEFAULT items in the VALUES
      RTE. Any DEFAULT item in the VALUES RTE that doesn't have a matching
      simple-Var-assignment in the targetlist is an error which we complain
      about, but in theory that ought to be impossible.
      
      Additionally, move this code into rewriteValuesRTE() to give a clearer
      separation of concerns between the 2 functions. There is no need for
      rewriteTargetListIU() to know about the details of the VALUES RTE.
      
      While at it, fix the comment for rewriteValuesRTE() which claimed that
      it doesn't support array element and field assignments --- that hasn't
      been true since a3c7a993 (9.6 and later).
      
      Back-patch to all supported versions, with minor differences for the
      pre-9.6 branches, which don't support array element and field
      assignments to the same column in multi-row VALUES lists.
      
      Reviewed by Amit Langote.
      
      Discussion: https://postgr.es/m/15623-5d67a46788ec8b7f@postgresql.org
      ed4653db
  6. 02 Mar, 2019 2 commits
  7. 01 Mar, 2019 8 commits
    • Tom Lane's avatar
      Check we don't misoptimize a NOT IN where the subquery returns no rows. · 3396138a
      Tom Lane authored
      Future-proofing against a common mistake in attempts to optimize NOT IN.
      We don't have such an optimization right now, but attempts to do so
      are in the works, and some of 'em are buggy.  Add a regression test case
      covering the point.
      
      David Rowley
      
      Discussion: https://postgr.es/m/CAKJS1f90E9agVZryVyUpbHQbjTt5ExqS2Fsodmt5_A7E_cEyVA@mail.gmail.com
      3396138a
    • 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