1. 26 Apr, 2021 7 commits
  2. 25 Apr, 2021 2 commits
  3. 24 Apr, 2021 5 commits
  4. 23 Apr, 2021 13 commits
  5. 22 Apr, 2021 10 commits
    • Tom Lane's avatar
      Don't crash on reference to an un-available system column. · d479d002
      Tom Lane authored
      Adopt a more consistent policy about what slot-type-specific
      getsysattr functions should do when system attributes are not
      available.  To wit, they should all throw the same user-oriented
      error, rather than variously crashing or emitting developer-oriented
      messages.
      
      This closes a identifiable problem in commits a71cfc56b and
      3fb93103a (in v13 and v12), so back-patch into those branches,
      along with a test case to try to ensure we don't break it again.
      It is not known that any of the former crash cases are reachable
      in HEAD, but this seems like a good safety improvement in any case.
      
      Discussion: https://postgr.es/m/141051591267657@mail.yandex.ru
      d479d002
    • Peter Eisentraut's avatar
      197d33cc
    • Alvaro Herrera's avatar
      Fix uninitialized memory bug · 43b55ec4
      Alvaro Herrera authored
      Have interested callers of find_inheritance_children set the
      detached_exist value to false prior to calling it, so that that routine
      only has to set it true in the rare cases where it is necessary.  Don't
      touch it otherwise.
      
      Per buildfarm member thorntail (which reported a UBSan failure here).
      43b55ec4
    • Bruce Momjian's avatar
      doc: mention <link> can be inside of <command>, but not <xref> · 84f15ccd
      Bruce Momjian authored
      This was discussed in commit 9081bddb.
      
      Reported-by: Peter Eisentraut
      
      Discussion: https://postgr.es/m/flat/87o8pco34z.fsf@wibble.ilmari.org
      84f15ccd
    • Andrew Dunstan's avatar
      Make PostgresVersion code a bit more robust and simple. · 502dc6df
      Andrew Dunstan authored
      per gripe from Alvaro Herrera.
      502dc6df
    • Alvaro Herrera's avatar
      Fix relcache inconsistency hazard in partition detach · 8aba9322
      Alvaro Herrera authored
      During queries coming from ri_triggers.c, we need to omit partitions
      that are marked pending detach -- otherwise, the RI query is tricked
      into allowing a row into the referencing table whose corresponding row
      is in the detached partition.  Which is bogus: once the detach operation
      completes, the row becomes an orphan.
      
      However, the code was not doing that in repeatable-read transactions,
      because relcache kept a copy of the partition descriptor that included
      the partition, and used it in the RI query.  This commit changes the
      partdesc cache code to only keep descriptors that aren't dependent on
      a snapshot (namely: those where no detached partition exist, and those
      where detached partitions are included).  When a partdesc-without-
      detached-partitions is requested, we create one afresh each time; also,
      those partdescs are stored in PortalContext instead of
      CacheMemoryContext.
      
      find_inheritance_children gets a new output *detached_exist boolean,
      which indicates whether any partition marked pending-detach is found.
      Its "include_detached" input flag is changed to "omit_detached", because
      that name captures desired the semantics more naturally.
      CreatePartitionDirectory() and RelationGetPartitionDesc() arguments are
      identically renamed.
      
      This was noticed because a buildfarm member that runs with relcache
      clobbering, which would not keep the improperly cached partdesc, broke
      one test, which led us to realize that the expected output of that test
      was bogus.  This commit also corrects that expected output.
      
      Author: Amit Langote <amitlangote09@gmail.com>
      Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
      Discussion: https://postgr.es/m/3269784.1617215412@sss.pgh.pa.us
      8aba9322
    • Tom Lane's avatar
      Doc: document the tie-breaking behavior of the round() function. · 82b13dbc
      Tom Lane authored
      Back-patch to v13; the table layout in older branches is unfriendly
      to adding such details.
      
      Laurenz Albe
      
      Discussion: https://postgr.es/m/161881920775.685.12293798764864559341@wrigleys.postgresql.org
      82b13dbc
    • Andrew Dunstan's avatar
      Make PostgresNode version aware · 4c4eaf3d
      Andrew Dunstan authored
      A new PostgresVersion object type is created and this is used in
      PostgresNode using the output of `pg_config --version` and the result
      stored in the PostgresNode object.  This object can be compared to other
      PostgresVersion objects, or to a number or string.
      
      PostgresNode is currently believed to be compatible with versions down
      to release 12, so PostgresNode will issue a warning if used with a
      version prior to that.
      
      No attempt has been made to deal with incompatibilities in older
      versions - that remains work to be undertaken in a subsequent
      development cycle.
      
      Based on code from Mark Dilger and Jehan-Guillaume de Rorthais.
      
      Discussion: https://postgr.es/m/a80421c0-3d7e-def1-bcfe-24777f15e344@dunslane.net
      4c4eaf3d
    • Michael Paquier's avatar
      Fix relation leak for subscribers firing triggers in logical replication · f3b141c4
      Michael Paquier authored
      Creating a trigger on a relation to which an apply operation is
      triggered would cause a relation leak once the change gets committed,
      as the executor would miss that the relation needs to be closed
      beforehand.  This issue got introduced with the refactoring done in
      1375422c, where it becomes necessary to track relations within
      es_opened_result_relations to make sure that they are closed.
      
      We have discussed using ExecInitResultRelation() coupled with
      ExecCloseResultRelations() for the relations in need of tracking by the
      apply operations in the subscribers, which would simplify greatly the
      opening and closing of indexes, but this requires a larger rework and
      reorganization of the worker code, particularly for the tuple routing
      part.  And that's not really welcome post feature freeze.  So, for now,
      settle down to the same solution as TRUNCATE which is to fill in
      es_opened_result_relations with the relation opened, to make sure that
      ExecGetTriggerResultRel() finds them and that they get closed.
      
      The code is lightly refactored so as a relation is not registered three
      times for each DML code path, making the whole a bit easier to follow.
      
      Reported-by: Tang Haiying, Shi Yu, Hou Zhijie
      Author: Amit Langote, Masahiko Sawada, Hou Zhijie
      Reviewed-by: Amit Kapila, Michael Paquier
      Discussion: https://postgr.es/m/OS0PR01MB611383FA0FE92EB9DE21946AFB769@OS0PR01MB6113.jpnprd01.prod.outlook.com
      f3b141c4
    • Michael Paquier's avatar
      doc: Move parallel_leader_participation to its correct category · 1599e7b3
      Michael Paquier authored
      parallel_leader_participation got introduced in e5253fdc, where it was
      listed under RESOURCES_ASYNCHRONOUS in guc.c, but the documentation
      did not reflect that and listed it with the other planner-related
      options.  This commit fixes this inconsistency as the parameter is
      intended to be an asynchronous one.
      
      While on it, reorganize a bit the section dedicated to asynchronous
      parameters, backend_flush_after being moved first to do better in terms
      of alphabetical order of the options listed.
      
      Reported-by: Yanliang Lei
      Author: Bharath Rupireddy
      Discussion: https://postgr.es/m/16972-42d4b0c15aa1d5f5@postgresql.org
      1599e7b3
  6. 21 Apr, 2021 3 commits