1. 08 Jan, 2020 7 commits
  2. 07 Jan, 2020 5 commits
  3. 06 Jan, 2020 5 commits
  4. 05 Jan, 2020 3 commits
  5. 04 Jan, 2020 5 commits
  6. 03 Jan, 2020 7 commits
    • Peter Geoghegan's avatar
      Add xl_btree_delete optimization. · d2e5e20e
      Peter Geoghegan authored
      Commit 558a9165 taught _bt_delitems_delete() to produce its own XID
      horizon on the primary.  Standbys no longer needed to generate their own
      latestRemovedXid, since they could just use the explicitly logged value
      from the primary instead.  The deleted offset numbers array from the
      xl_btree_delete WAL record was no longer used by the REDO routine for
      anything other than deleting the items.
      
      This enables a minor optimization:  We now treat the array as buffer
      state, not generic WAL data, following _bt_delitems_vacuum()'s example.
      This should be a minor win, since it allows us to avoid including the
      deleted items array in cases where XLogInsert() stores the whole buffer
      anyway.  The primary goal here is to make the code more maintainable,
      though.  Removing inessential differences between the two functions
      highlights the fundamental differences that remain.
      
      Also change xl_btree_delete to use uint32 for the size of the array of
      item offsets being deleted.  This brings xl_btree_delete closer to
      xl_btree_vacuum.  Furthermore, it seems like a good idea to use an
      explicit-width integer type (the field was previously an "int").
      
      Bump XLOG_PAGE_MAGIC because xl_btree_delete changed.
      
      Discussion: https://postgr.es/m/CAH2-Wzkz4TjmezzfAbaV1zYrh=fr0bCpzuJTvBe5iUQ3aUPsCQ@mail.gmail.com
      d2e5e20e
    • Tom Lane's avatar
      Further fixes for tab-completion TAP tests. · 56a3921a
      Tom Lane authored
      Escape non-printable characters in failure reports, by using Data::Dumper
      in Useqq mode.  Also, bump $Test::Builder::Level so the diagnostic
      references the calling line, and use diag() instad of note(),
      so it shows even in non-verbose mode (per request from Christoph Berg).
      
      Also, give up on trying to test for the specific way that readline
      chooses to overwrite existing text in the \DRD -> \drds test.
      There are too many variants, it seems, at least on the libedit
      side of things.
      
      Dagfinn Ilmari Mannsåker and Tom Lane
      
      Discussion: https://postgr.es/m/20200103110128.GA28967@msg.df7cb.de
      56a3921a
    • Tom Lane's avatar
      Add an ugly workaround for a bug in some recent libedit versions. · ddd87d56
      Tom Lane authored
      Debian unstable is shipping a broken version of libedit: it de-escapes
      words before passing them to the application's tab completion function,
      preventing us from recognizing backslash commands.  Fortunately,
      we have enough information available to dig the original text out of
      rl_line_buffer, so ignore the string argument and do that.
      
      I view this as a temporary workaround to get the affected buildfarm
      members back to green in the wake of 7c015045.  I hope we can get
      rid of it once somebody fixes Debian's libedit; hence, no back-patch,
      at least for now.
      
      Discussion: https://postgr.es/m/20200103110128.GA28967@msg.df7cb.de
      ddd87d56
    • Peter Eisentraut's avatar
      pgbench: Improve test description · 04334fde
      Peter Eisentraut authored
      Author: Fabien COELHO <coelho@cri.ensmp.fr>
      04334fde
    • Amit Kapila's avatar
      Fix typos in parallel query docs. · d5b6b651
      Amit Kapila authored
      Reported-by: Jon Jensen
      Author: Jon Jensen
      Reviewed-by: Amit Kapila and Robert Haas
      Backpatch-through: 10
      Discussion: https://postgr.es/m/nycvar.YSQ.7.76.1912301807510.9899@ybpnyubfg
      d5b6b651
    • Peter Geoghegan's avatar
      Clear up btree_xlog_split() alignment comment. · 0c41c83d
      Peter Geoghegan authored
      Adjust a comment that describes how alignment of the new left page high
      key works in btree_xlog_split(), the nbtree page split REDO routine.
      The wording used before commit 2c03216d is much clearer, so go back
      to that.
      0c41c83d
    • Tom Lane's avatar
      Minor portability fixes for new TAP script. · 90d7f660
      Tom Lane authored
      Satisfy perlcritic, mostly.  Per buildfarm.
      90d7f660
  7. 02 Jan, 2020 8 commits
    • Peter Geoghegan's avatar
      Correct _bt_delitems_vacuum() lock comments. · 44e44bd2
      Peter Geoghegan authored
      The expectation within _bt_delitems_vacuum() is that caller has a
      super-exclusive/cleanup buffer lock (not just a pin and a write lock).
      44e44bd2
    • Alvaro Herrera's avatar
      Fix cloning of row triggers to sub-partitions · 1fa846f1
      Alvaro Herrera authored
      When row triggers exist in partitioned partitions that are not either
      part of FKs or deferred unique constraints, they are not correctly
      cloned to their partitions.  That's because they are marked "internal",
      and those are purposefully skipped when doing the clone triggers dance.
      Fix by relaxing the condition on which internal triggers are skipped.
      
      Amit Langote initially diagnosed the problem and proposed a fix, but I
      used a different approach.
      
      Reported-by: Petr Fedorov
      Discussion: https://postgr.es/m/6b3f0646-ba8c-b3a9-c62d-1c6651a1920f@phystech.edu
      1fa846f1
    • Tom Lane's avatar
      Add basic TAP tests for psql's tab-completion logic. · 7c015045
      Tom Lane authored
      Up to now, psql's tab-complete.c has had exactly no regression test
      coverage.  This patch is an experimental attempt to add some.
      
      This needs Perl's IO::Pty module, which isn't installed everywhere,
      so the test script just skips all tests if that's not present.
      There may be other portability gotchas too, so I await buildfarm
      results with interest.
      
      So far this just covers a few very basic keyword-completion and
      query-driven-completion scenarios, which should be enough to let us
      get a feel for whether this is practical at all from a portability
      standpoint.  If it is, there's lots more that can be done.
      
      Discussion: https://postgr.es/m/10967.1577562752@sss.pgh.pa.us
      7c015045
    • Tom Lane's avatar
      Fix typmod exposed for scalar function in FROM, too. · 915c04f0
      Tom Lane authored
      On further reflection about commit 4d02eb01, it occurs to me that
      expandRTE() had better agree with what addRangeTableEntryForFunction()
      is doing.  So teach that about functions possibly having typmods, too.
      915c04f0
    • Peter Geoghegan's avatar
      Reorder two nbtree.h function prototypes. · a412f469
      Peter Geoghegan authored
      Make the function prototype order consistent with the definition order
      in nbtpage.c.
      a412f469
    • Tom Lane's avatar
      Fix collation exposed for scalar function in FROM. · 4d02eb01
      Tom Lane authored
      One code path in addRangeTableEntryForFunction() neglected to assign
      a collation to the tupdesc entry it constructs (which is a bit odd
      considering the other path did do so).  This didn't matter before commit
      5815696b, because nothing would look at the type data in this tupdesc;
      but now it does.
      
      While at it, make sure we assign the correct typmod as well.  Most
      function expressions don't have a determinate typmod, but some do.
      
      Per buildfarm, which showed failures in non-C collations, a case
      I'd not thought to test for this patch :-(
      4d02eb01
    • Tom Lane's avatar
      Make parser rely more heavily on the ParseNamespaceItem data structure. · 5815696b
      Tom Lane authored
      When I added the ParseNamespaceItem data structure (in commit 5ebaaa49),
      it wasn't very tightly integrated into the parser's APIs.  In the wake of
      adding p_rtindex to that struct (commit b541e9ac), there is a good reason
      to make more use of it: by passing around ParseNamespaceItem pointers
      instead of bare RTE pointers, we can get rid of various messy methods for
      passing back or deducing the rangetable index of an RTE during parsing.
      Hence, refactor the addRangeTableEntryXXX functions to build and return
      a ParseNamespaceItem struct, not just the RTE proper; and replace
      addRTEtoQuery with addNSItemToQuery, which is passed a ParseNamespaceItem
      rather than building one internally.
      
      Also, add per-column data (a ParseNamespaceColumn array) to each
      ParseNamespaceItem.  These arrays are built during addRangeTableEntryXXX,
      where we have column type data at hand so that it's nearly free to fill
      the data structure.  Later, when we need to build Vars referencing RTEs,
      we can use the ParseNamespaceColumn info to avoid the rather expensive
      operations done in get_rte_attribute_type() or expandRTE().
      get_rte_attribute_type() is indeed dead code now, so I've removed it.
      This makes for a useful improvement in parse analysis speed, around 20%
      in one moderately-complex test query.
      
      The ParseNamespaceColumn structs also include Var identity information
      (varno/varattno).  That info isn't actually being used in this patch,
      except that p_varno == 0 is a handy test for a dropped column.
      A follow-on patch will make more use of it.
      
      Discussion: https://postgr.es/m/2461.1577764221@sss.pgh.pa.us
      5815696b
    • Peter Eisentraut's avatar
      Fix comment in test · 198c7153
      Peter Eisentraut authored
      The comment was apparently copy-and-pasted and did not reflect the
      actual test outcome.
      198c7153