1. 05 Sep, 2020 6 commits
    • 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
  2. 04 Sep, 2020 14 commits
  3. 03 Sep, 2020 7 commits
  4. 02 Sep, 2020 7 commits
  5. 01 Sep, 2020 6 commits
    • Tom Lane's avatar
      Improve test coverage of ginvacuum.c. · 4c51a2d1
      Tom Lane authored
      Add a test case that exercises vacuum's deletion of empty GIN
      posting pages.  Since this is a temp table, it should now work
      reliably to delete a bunch of rows and immediately VACUUM.
      Before the preceding commit, this would not have had the desired
      effect, at least not in parallel regression tests.
      
      Discussion: https://postgr.es/m/3490536.1598629609@sss.pgh.pa.us
      4c51a2d1
    • Tom Lane's avatar
      Set cutoff xmin more aggressively when vacuuming a temporary table. · a7212be8
      Tom Lane authored
      Since other sessions aren't allowed to look into a temporary table
      of our own session, we do not need to worry about the global xmin
      horizon when setting the vacuum XID cutoff.  Indeed, if we're not
      inside a transaction block, we may set oldestXmin to be the next
      XID, because there cannot be any in-doubt tuples in a temp table,
      nor any tuples that are dead but still visible to some snapshot of
      our transaction.  (VACUUM, of course, is never inside a transaction
      block; but we need to test that because CLUSTER shares the same code.)
      
      This approach allows us to always clean out a temp table completely
      during VACUUM, independently of concurrent activity.  Aside from
      being useful in its own right, that simplifies building reproducible
      test cases.
      
      Discussion: https://postgr.es/m/3490536.1598629609@sss.pgh.pa.us
      a7212be8
    • Bruce Momjian's avatar
      doc: clarify that max_wal_size is "during" checkpoints · db864c3c
      Bruce Momjian authored
      Previous wording was "between".
      
      Reported-by: Pavel Luzanov
      
      Discussion: https://postgr.es/m/26906a54-d7cb-2f8e-eed7-e31660024694@postgrespro.ru
      
      Backpatch-through: 9.5
      db864c3c
    • Alvaro Herrera's avatar
      Raise error on concurrent drop of partitioned index · afc7e0ad
      Alvaro Herrera authored
      We were already raising an error for DROP INDEX CONCURRENTLY on a
      partitioned table, albeit a different and confusing one:
        ERROR:  DROP INDEX CONCURRENTLY must be first action in transaction
      
      Change that to throw a more comprehensible error:
        ERROR:  cannot drop partitioned index \"%s\" concurrently
      
      Michael Paquier authored the test case for indexes on temporary
      partitioned tables.
      
      Backpatch to 11, where indexes on partitioned tables were added.
      Reported-by: default avatarJan Mussler <jan.mussler@zalando.de>
      Reviewed-by: default avatarMichael Paquier <michael@paquier.xyz>
      Discussion: https://postgr.es/m/16594-d2956ca909585067@postgresql.org
      afc7e0ad
    • Tom Lane's avatar
      Teach libpq to handle arbitrary-length lines in .pgpass files. · b55b4dad
      Tom Lane authored
      Historically there's been a hard-wired assumption here that no line of
      a .pgpass file could be as long as NAMEDATALEN*5 bytes.  That's a bit
      shaky to start off with, because (a) there's no reason to suppose that
      host names fit in NAMEDATALEN, and (b) this figure fails to allow for
      backslash escape characters.  However, it fails completely if someone
      wants to use a very long password, and we're now hearing reports of
      people wanting to use "security tokens" that can run up to several
      hundred bytes.  Another angle is that the file is specified to allow
      comment lines, but there's no reason to assume that long comment lines
      aren't possible.
      
      Rather than guessing at what might be a more suitable limit, let's
      replace the fixed-size buffer with an expansible PQExpBuffer.  That
      adds one malloc/free cycle to the typical use-case, but that's surely
      pretty cheap relative to the I/O this code has to do.
      
      Also, add TAP test cases to exercise this code, because there was no
      test coverage before.
      
      This reverts most of commit 2eb3bc58, as there's no longer a need for
      a warning message about overlength .pgpass lines.  (I kept the explicit
      check for comment lines, though.)
      
      In HEAD and v13, this also fixes an oversight in 74a308cf: there's not
      much point in explicit_bzero'ing the line buffer if we only do so in two
      of the three exit paths.
      
      Back-patch to all supported branches, except that the test case only
      goes back to v10 where src/test/authentication/ was added.
      
      Discussion: https://postgr.es/m/4187382.1598909041@sss.pgh.pa.us
      b55b4dad
    • Amit Kapila's avatar
      Fix the SharedFileSetUnregister API. · 4ab77697
      Amit Kapila authored
      Commit 808e13b2 introduced a few APIs to extend the existing Buffile
      interface. In SharedFileSetDeleteOnProcExit, it tries to delete the list
      element while traversing the list with 'foreach' construct which makes the
      behavior of list traversal unpredictable.
      
      Author: Amit Kapila
      Reviewed-by: Dilip Kumar
      Tested-by: Dilip Kumar and Neha Sharma
      Discussion: https://postgr.es/m/CAA4eK1JhLatVcQ2OvwA_3s0ih6Hx9+kZbq107cXVsSWWukH7vA@mail.gmail.com
      4ab77697