1. 08 Sep, 2020 8 commits
  2. 07 Sep, 2020 10 commits
  3. 06 Sep, 2020 8 commits
  4. 05 Sep, 2020 9 commits
    • Tom Lane's avatar
      Improve some ancient, crufty code in bootstrap + initdb. · e0f05cd5
      Tom Lane authored
      At some point back in the last century, somebody felt that reading
      all of pg_type twice was cheaper, or at least easier, than using
      repalloc() to resize the Typ[] array dynamically.  That seems like an
      entirely wacko proposition, so rewrite the code to do it the other
      way.  (To add insult to injury, there were two not-quite-identical
      copies of said code.)
      
      initdb.c's readfile() function had the same disease of preferring
      to do double the I/O to avoid resizing its output array.  Here,
      we can make things easier by using the just-invented pg_get_line()
      function to handle reading individual lines without a predetermined
      notion of how long they are.
      
      On my machine, it's difficult to detect any net change in the
      overall runtime of initdb from these changes; but they should
      help on slower buildfarm machines (especially since a buildfarm
      cycle involves a lot of initdb's these days).
      
      My attention was drawn to these places by scan-build complaints,
      but on inspection they needed a lot more work than just suppressing
      dead stores :-(
      e0f05cd5
    • Tom Lane's avatar
      Yet more elimination of dead stores and useless initializations. · a5cc4dab
      Tom Lane authored
      I'm not sure what tool Ranier was using, but the ones I contributed
      were found by using a newer version of scan-build than I tried before.
      
      Ranier Vilela and Tom Lane
      
      Discussion: https://postgr.es/m/CAEudQAo1+AcGppxDSg8k+zF4+Kv+eJyqzEDdbpDg58-=MQcerQ@mail.gmail.com
      a5cc4dab
    • Michael Paquier's avatar
      Switch to multi-inserts when registering dependencies for many code paths · 8febfd18
      Michael Paquier authored
      This commit improves the dependency registrations by taking advantage of
      the preliminary work done in 63110c62, to group together the insertion
      of dependencies of the same type to pg_depend.  With the current layer
      of routines available, and as only dependencies of the same type can be
      grouped, there are code paths still doing more than one multi-insert
      when it is necessary to register dependencies of multiple types
      (constraint and index creation are two cases doing that).
      
      While on it, this refactors some of the code to use ObjectAddressSet()
      when manipulating object addresses.
      
      Author: Daniel Gustafsson, Michael Paquier
      Reviewed-by: Andres Freund, Álvaro Herrera
      Discussion: https://postgr.es/m/20200807061619.GA23955@paquier.xyz
      8febfd18
    • Peter Eisentraut's avatar
      Extend SQL function tests lightly · 11b80d90
      Peter Eisentraut authored
      The basic tests that defined SQL functions didn't actually run the
      functions to see if they worked.  Add that, and also fix a minor
      mistake in a function that was revealed by this.  (This is not a
      question of test coverage, since there are other places where SQL
      functions are run, but it is a bit of a silly test design.)
      
      Discussion: https://www.postgresql.org/message-id/flat/1c11f1eb-f00c-43b7-799d-2d44132c02d7@2ndquadrant.com
      11b80d90
    • Peter Eisentraut's avatar
      Fix typo in comment · 556cbdfc
      Peter Eisentraut authored
      556cbdfc
    • Michael Paquier's avatar
      Use multi-inserts for pg_depend · 63110c62
      Michael Paquier authored
      This is a follow-up of the work done in e3931d01.  This case is a bit
      different than pg_attribute and pg_shdepend: the maximum number of items
      to insert is known in advance, but there is no need to handle pinned
      dependencies.  Hence, the base allocation for slots is done based on the
      number of items and the maximum allowed with a cap at 64kB.  Slots are
      initialized once used to minimize the overhead of the operation.
      
      The insertions can be done for dependencies of the same type.  More
      could be done by grouping the insertion of multiple dependency types in
      a single batch.  This is left as future work.
      
      Some of the multi-insert logic is also simplified for pg_shdepend, as
      per the feedback discussed for this specific patch.  This also moves to
      indexing.h the variable capping the maximum amount of data that can be
      used at once for a multi-insert, instead of having separate definitions
      for pg_attribute, pg_depend and pg_shdepend.
      
      Author: Daniel Gustafsson, Michael Paquier
      Reviewed-by: Andres Freund, Álvaro Herrera
      Discussion: https://postgr.es/m/20200807061619.GA23955@paquier.xyz
      63110c62
    • Tom Lane's avatar
      Make new authentication test case more robust. · 4d41823c
      Tom Lane authored
      I happened to notice that the new test case I added in b55b4dad
      falls over if one runs "make check" repeatedly; though not in branches
      after v10.  That's because it was assuming that tmp_check/pgpass
      wouldn't exist already.  However, it's only been since v11 that the
      Makefiles forcibly remove all of tmp_check/ before starting a TAP run.
      This fix to unlink the file is therefore strictly necessary only in
      v10 ... but it seems wisest to do it across the board, rather than
      let the test rely on external logic to get the conditions right.
      4d41823c
    • Tom Lane's avatar
      Fix over-eager ping'ing in logical replication receiver. · c8746f99
      Tom Lane authored
      Commit 3f60f690 only partially fixed the broken-status-tracking
      issue in LogicalRepApplyLoop: we need ping_sent to have the same
      lifetime as last_recv_timestamp.  The effects are much less serious
      than what that commit fixed, though.  AFAICS this would just lead to
      extra ping requests being sent, once per second until the sender
      responds.  Still, it's a bug, so backpatch to v10 as before.
      
      Discussion: https://postgr.es/m/959627.1599248476@sss.pgh.pa.us
      c8746f99
    • Tom Lane's avatar
      Remove still more useless assignments. · 9a851039
      Tom Lane authored
      Fix some more things scan-build pointed to as dead stores.  In some of
      these cases, rearranging the code a little leads to more readable
      code IMO.  It's all cosmetic, though.
      
      Discussion: https://postgr.es/m/CAEudQAo1+AcGppxDSg8k+zF4+Kv+eJyqzEDdbpDg58-=MQcerQ@mail.gmail.com
      9a851039
  5. 04 Sep, 2020 5 commits