1. 20 Jan, 2021 8 commits
    • Tomas Vondra's avatar
      Implement support for bulk inserts in postgres_fdw · b663a413
      Tomas Vondra authored
      Extends the FDW API to allow batching inserts into foreign tables. That
      is usually much more efficient than inserting individual rows, due to
      high latency for each round-trip to the foreign server.
      
      It was possible to implement something similar in the regular FDW API,
      but it was inconvenient and there were issues with reporting the number
      of actually inserted rows etc. This extends the FDW API with two new
      functions:
      
      * GetForeignModifyBatchSize - allows the FDW picking optimal batch size
      
      * ExecForeignBatchInsert - inserts a batch of rows at once
      
      Currently, only INSERT queries support batching. Support for DELETE and
      UPDATE may be added in the future.
      
      This also implements batching for postgres_fdw. The batch size may be
      specified using "batch_size" option both at the server and table level.
      
      The initial patch version was written by me, but it was rewritten and
      improved in many ways by Takayuki Tsunakawa.
      
      Author: Takayuki Tsunakawa
      Reviewed-by: Tomas Vondra, Amit Langote
      Discussion: https://postgr.es/m/20200628151002.7x5laxwpgvkyiu3q@development
      b663a413
    • Tomas Vondra's avatar
      psql \dX: list extended statistics objects · ad600bba
      Tomas Vondra authored
      The new command lists extended statistics objects. All past releases
      with extended statistics are supported.
      
      This is a simplified version of commit 891a1d0b, which had to be
      reverted due to not considering pg_statistic_ext_data is not accessible
      by regular users. Fields requiring access to this catalog were removed.
      It's possible to add them, but it'll require changes to core.
      
      Author: Tatsuro Yamada
      Reviewed-by: Julien Rouhaud, Alvaro Herrera, Tomas Vondra, Noriyoshi Shinoda
      Discussion: https://postgr.es/m/c027a541-5856-75a5-0868-341301e1624b%40nttcom.co.jp_1
      ad600bba
    • Tom Lane's avatar
      Further tweaking of PG_SYSROOT heuristics for macOS. · 9d23c15a
      Tom Lane authored
      It emerges that in some phases of the moon (perhaps to do with
      directory entry order?), xcrun will report that the SDK path is
        /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
      which is normally a symlink to a version-numbered sibling directory.
      Our heuristic to skip non-version-numbered pathnames was rejecting
      that, which is the wrong thing to do.  We'd still like to end up
      with a version-numbered PG_SYSROOT value, but we can have that by
      dereferencing the symlink.
      
      Like the previous fix, back-patch to all supported versions.
      
      Discussion: https://postgr.es/m/522433.1611089678@sss.pgh.pa.us
      9d23c15a
    • Tom Lane's avatar
      Disable vacuum page skipping in selected test cases. · c2dc1a79
      Tom Lane authored
      By default VACUUM will skip pages that it can't immediately get
      exclusive access to, which means that even activities as harmless
      and unpredictable as checkpoint buffer writes might prevent a page
      from being processed.  Ordinarily this is no big deal, but we have
      a small number of test cases that examine the results of VACUUM's
      processing and therefore will fail if the page of interest is skipped.
      This seems to be the explanation for some rare buildfarm failures.
      To fix, add the DISABLE_PAGE_SKIPPING option to the VACUUM commands
      in tests where this could be an issue.
      
      In passing, remove a duplicated query in pageinspect/sql/page.sql.
      
      Back-patch as necessary (some of these cases are as old as v10).
      
      Discussion: https://postgr.es/m/413923.1611006484@sss.pgh.pa.us
      c2dc1a79
    • Heikki Linnakangas's avatar
      Fix bug in detecting concurrent page splits in GiST insert · 6b4d3046
      Heikki Linnakangas authored
      In commit 9eb5607e, I got the condition on checking for split or
      deleted page wrong: I used && instead of ||. The comment correctly said
      "concurrent split _or_ deletion".
      
      As a result, GiST insertion could miss a concurrent split, and insert to
      wrong page. Duncan Sands demonstrated this with a test script that did a
      lot of concurrent inserts.
      
      Backpatch to v12, where this was introduced. REINDEX is required to fix
      indexes that were affected by this bug.
      
      Backpatch-through: 12
      Reported-by: Duncan Sands
      Discussion: https://www.postgresql.org/message-id/a9690483-6c6c-3c82-c8ba-dc1a40848f11%40deepbluecap.com
      6b4d3046
    • Thomas Munro's avatar
      Fix sample output of EXPLAIN ANALYZE. · 679744cf
      Thomas Munro authored
      Since commit f0f13a3a, we estimate
      ModifyTable paths without a RETURNING clause differently.  Update an
      example from the manual that showed the old behavior.
      
      Author: Takayuki Tsunakawa <tsunakawa.takay@fujitsu.com>
      Reviewed-by: default avatarLaurenz Albe <laurenz.albe@cybertec.at>
      Discussion: https://postgr.es/m/TYAPR01MB29905674F41693BBA9DA28CAFEA20%40TYAPR01MB2990.jpnprd01.prod.outlook.com
      679744cf
    • Michael Paquier's avatar
      Add regression test for DROP OWNED BY with default ACLs · a36dc04d
      Michael Paquier authored
      DROP OWNED BY has a specific code path to remove ACLs stored in
      pg_default_acl when cleaning up shared dependencies that had no
      coverage with the existing tests.  This issue has been found while
      digging into the bug fixed by 21378e1f.
      
      As ALTER DEFAULT PRIVILEGES impacts the ACLs of all objects created
      while the default permissions are visible, the test uses a transaction
      rollback to isolate the test and avoid any impact with other sessions
      running in parallel.
      
      Reviewed-by: Álvaro Herrera
      Discussion: https://postgr.es/m/YAbQ1OD+3ip4lRv8@paquier.xyz
      a36dc04d
    • Michael Paquier's avatar
      Fix ALTER DEFAULT PRIVILEGES with duplicated objects · 21378e1f
      Michael Paquier authored
      Specifying duplicated objects in this command would lead to unique
      constraint violations in pg_default_acl or "tuple already updated by
      self" errors.  Similarly to GRANT/REVOKE, increment the command ID after
      each subcommand processing to allow this case to work transparently.
      
      A regression test is added by tweaking one of the existing queries of
      privileges.sql to stress this case.
      
      Reported-by: Andrus
      Author: Michael Paquier
      Reviewed-by: Álvaro Herrera
      Discussion: https://postgr.es/m/ae2a7dc1-9d71-8cba-3bb9-e4cb7eb1f44e@hot.ee
      Backpatch-through: 9.5
      21378e1f
  2. 19 Jan, 2021 4 commits
  3. 18 Jan, 2021 10 commits
  4. 17 Jan, 2021 7 commits
  5. 16 Jan, 2021 5 commits
  6. 15 Jan, 2021 6 commits