Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lapt8-0005kl-Su for pgsql-announce@arkaria.postgresql.org; Mon, 26 Apr 2021 01:18:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lapt7-0006KE-QQ for pgsql-announce@arkaria.postgresql.org; Mon, 26 Apr 2021 01:18:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lapt6-0006K5-39 for pgsql-announce@lists.postgresql.org; Mon, 26 Apr 2021 01:18:12 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lapt0-0003Xt-Tz for pgsql-announce@lists.postgresql.org; Mon, 26 Apr 2021 01:18:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:From:To:Subject: MIME-Version:Content-Type:Sender:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=Bq3FQoj8KnTWhPY9EQLFzeUmfGWCJcQBA9tJFxtpXHI=; b=mZNqLsPjAAPNTcO+PcXpyRt3Zm FTx5C965cq8cBuGe9AtP5bOnAIGmyooXTLrzlsfMUnpLeJbM3IPHbag5/AAq6C4yfgdPYRhl3k4sZ 9H1mngSADxDQcPZ0wEZ3XIpwwwFCORzqu9Y0S1bKaZPO+rfCV+ardpoU5//H1bblqYdPGtDIbOWgi HQ99buZehMgKn8dikCHcD+VdZMG0g/a18GMpu/VGfIf9Fkj+Pg/zcqDl9wKAIOp9i3vEV0uHnmkBy lrJ6NZKAfFZtGOP1V3xTGWwcXSls+pIedfPnUggMtEIEPB8/Y5TJyCwRFfrp0MqJIfL+T/lX6yHdo JORSDlUw==; Received: from wrigleys.postgresql.org ([2a02:c0:301:0:ffff::34]) by mahout.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lapt0-00081A-4O for pgsql-announce@lists.postgresql.org; Mon, 26 Apr 2021 01:18:06 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lapsw-0001z1-GE for pgsql-announce@lists.postgresql.org; Mon, 26 Apr 2021 01:18:02 +0000 Content-Type: multipart/mixed; boundary="===============1928479652468271500==" MIME-Version: 1.0 Subject: PostgreSQL Weekly News - April 25, 2021 To: PostgreSQL Announce From: PWN via PostgreSQL Announce Reply-To: david@fetter.org Date: Mon, 26 Apr 2021 01:17:46 +0000 Message-ID: <161939986624.695.18229954984214852469@wrigleys.postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-pglister-tags: pwn X-pglister-tagsig: d1f378dadfb04fa707d6a888c2babbfe1d04fe1aeff02eb34db551d421f46ae9 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --===============1928479652468271500== Content-Type: multipart/alternative; boundary="===============4183336256831844997==" MIME-Version: 1.0 --===============4183336256831844997== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable # PostgreSQL Weekly News - April 25, 2021 Person of the week: [https://postgresql.life/post/pavlo_golub/](https://pos= tgresql.life/post/pavlo_golub/) # PostgreSQL Product News JDBC 42.2.20 released https://jdbc.postgresql.org/documentation/changelog.html#version_42.2.20 kubgres 1.1, a Kubernetes operator which makes it possible to deploy a clus= ter of PostgreSQL pods with replication and failover configured, released. [https://github.com/reactive-tech/kubegres/releases/tag/v1.1](https://githu= b.com/reactive-tech/kubegres/releases/tag/v1.1) pspg 4.6.1 a pager designed for PostgreSQL, released. https://github.com/okbob/pspg/releases/tag/4.6.1 pgAdmin4 5.2, a web- and native GUI control center for PostgreSQL, released. https://www.pgadmin.org/docs/pgadmin4/5.2/release_notes_5_2.html pg_log_statements 0.2, an extension that makes is possible to log statement= s for specific server processes, released. [https://github.com/pierreforstmann/pg_log_statements/releases](https://git= hub.com/pierreforstmann/pg_log_statements/releases) # PostgreSQL Jobs for April [https://archives.postgresql.org/pgsql-jobs/2021-04/](https://archives.post= gresql.org/pgsql-jobs/2021-04/) # PostgreSQL in the News Planet PostgreSQL: [https://planet.postgresql.org/](https://planet.postgres= ql.org/) PostgreSQL Weekly News is brought to you this week by David Fetter Submit news and announcements by Sunday at 3:00pm PST8PDT to david@fetter.o= rg. # Applied Patches Thomas Munro pushed: - Explain postmaster's treatment of SIGURG. Add a few words of comment to explain why SIGURG doesn't follow the dummy_handler pattern used for SIGU= SR2, since that might otherwise appear to be a bug. Discussion: [https://postgr.es/m/4006115.1618577212%40sss.pgh.pa.us](https://postgr.e= s/m/4006115.1618577212%40sss.pgh.pa.us) [https://git.postgresql.org/pg/commitdiff/8e861eaae86eeaf5589963c9b1c7ce6= d4c2acbb5](https://git.postgresql.org/pg/commitdiff/8e861eaae86eeaf5589963c= 9b1c7ce6d4c2acbb5) Micha=C3=ABl Paquier pushed: - Replace magic constants for seek() calls in perl scripts. A couple of tes= ts have been using 0 as magic constant while SEEK_SET can be used instead. = This makes the code easier to understand, and more consistent with the changes= done in 3c5b068. Per discussion with Andrew Dunstan. Discussion: [https://postgr.es/m/YHrc24AgJQ6tQ1q0@paquier.xyz](https://postgr.es/m/YH= rc24AgJQ6tQ1q0@paquier.xyz) [https://git.postgresql.org/pg/commitdiff/c731f9187b5fd7038b04ba60703d3ca= ce1806366](https://git.postgresql.org/pg/commitdiff/c731f9187b5fd7038b04ba6= 0703d3cace1806366) - Fix typos and grammar in comments and docs. Author: Justin Pryzby Discuss= ion: [https://postgr.es/m/20210416070310.GG3315@telsasoft.com](https://postgr.= es/m/20210416070310.GG3315@telsasoft.com) [https://git.postgresql.org/pg/commitdiff/7ef8b52cf079ef3ace4575f7b97c2d6= f80463b4f](https://git.postgresql.org/pg/commitdiff/7ef8b52cf079ef3ace4575f= 7b97c2d6f80463b4f) - Add CURRENT_ROLE to list of roles for tab completion of GRANT in psql. Th= is compatibility has been added in 45b9805, but psql forgot the call. Autho= r: Wei Wang Reviewed-by: Aleksander Alekseev Discussion: [https://postgr.es/m/OS3PR01MB6275935F62E161BCD393D6559E489@OS3PR01MB6275= .jpnprd01.prod.outlook.com](https://postgr.es/m/OS3PR01MB6275935F62E161BCD3= 93D6559E489@OS3PR01MB6275.jpnprd01.prod.outlook.com) [https://git.postgresql.org/pg/commitdiff/22b2dec31b2ef4dfee299290b16375e= 9fa6e6932](https://git.postgresql.org/pg/commitdiff/22b2dec31b2ef4dfee29929= 0b16375e9fa6e6932) - doc: List compute_query_id in required config for pg_stat_statements. Not enabling compute_query_id would disable pg_stat_statements even if the mo= dule is listed in shared_preload_libraries, so add it to the minimum configura= tion set as listed in its documentation. Author: Greg Nancarrow Reviewed-by: Julien Rouhaud, Bharath Rupireddy Discussion: [https://postgr.es/m/CAJcOf-fXyb2QiDbwftD813UF70w-+BsK-03bFp1GrijXU9GQYQ@= mail.gmail.com](https://postgr.es/m/CAJcOf-fXyb2QiDbwftD813UF70w-+BsK-03bFp= 1GrijXU9GQYQ@mail.gmail.com) [https://git.postgresql.org/pg/commitdiff/64087eb5def7786bd49e60eb5d984ec= 6e4a872a9](https://git.postgresql.org/pg/commitdiff/64087eb5def7786bd49e60e= b5d984ec6e4a872a9) - doc: Move parallel_leader_participation to its correct category. parallel_leader_participation got introduced in e5253fd, where it was lis= ted under RESOURCES_ASYNCHRONOUS in guc.c, but the documentation did not refl= ect that and listed it with the other planner-related options. This commit f= ixes 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 Auth= or: Bharath Rupireddy Discussion: [https://postgr.es/m/16972-42d4b0c15aa1d5f5@postgresql.org](https://postg= r.es/m/16972-42d4b0c15aa1d5f5@postgresql.org) [https://git.postgresql.org/pg/commitdiff/1599e7b375127cac81b539d2c69d3fa= f7598509b](https://git.postgresql.org/pg/commitdiff/1599e7b375127cac81b539d= 2c69d3faf7598509b) - Fix relation leak for subscribers firing triggers in logical replication. 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 execut= or would miss that the relation needs to be closed beforehand. This issue g= ot introduced with the refactoring done in 1375422c, where it becomes necess= ary to track relations within es_opened_result_relations to make sure that th= ey are closed. We have discussed using ExecInitResultRelation() coupled with ExecCloseResultRelations() for the relations in need of tracking by the a= pply operations in the subscribers, which would simplify greatly the opening a= nd 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 a= nd 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 eas= ier to follow. Reported-by: Tang Haiying, Shi Yu, Hou Zhijie Author: Amit Langote, Masahiko Sawada, Hou Zhijie Reviewed-by: Amit Kapila, Michael Pa= quier Discussion: [https://postgr.es/m/OS0PR01MB611383FA0FE92EB9DE21946AFB769@OS0PR01MB6113= .jpnprd01.prod.outlook.com](https://postgr.es/m/OS0PR01MB611383FA0FE92EB9DE= 21946AFB769@OS0PR01MB6113.jpnprd01.prod.outlook.com) [https://git.postgresql.org/pg/commitdiff/f3b141c482552a57866c72919007d64= 81cd59ee3](https://git.postgresql.org/pg/commitdiff/f3b141c482552a57866c729= 19007d6481cd59ee3) - Remove use of [U]INT64_FORMAT in some translatable strings. %lld with (lo= ng long), or %llu with (unsigned long long) are more adapted. This is simil= ar to 3286065. Author: Kyotaro Horiguchi Discussion: [https://postgr.es/m/20210421.200000.1462448394029407895.horikyota.ntt@gm= ail.com](https://postgr.es/m/20210421.200000.1462448394029407895.horikyota.= ntt@gmail.com) [https://git.postgresql.org/pg/commitdiff/62aa2bb293148c13851484e63db4835= e3c53147f](https://git.postgresql.org/pg/commitdiff/62aa2bb293148c13851484e= 63db4835e3c53147f) - Fix some comments in fmgr.c. Oversight in 2a0faed. Author: Hou Zhijie Discussion: [https://postgr.es/m/OS0PR01MB5716405E2464D85E6DB6DC0794469@OS0PR01MB5716= .jpnprd01.prod.outlook.com](https://postgr.es/m/OS0PR01MB5716405E2464D85E6D= B6DC0794469@OS0PR01MB5716.jpnprd01.prod.outlook.com) [https://git.postgresql.org/pg/commitdiff/45c0c5f70eb5e22d31be8bb9a8b4d9c= 66a3e9b37](https://git.postgresql.org/pg/commitdiff/45c0c5f70eb5e22d31be8bb= 9a8b4d9c66a3e9b37) - Add some forgotten LSN_FORMAT_ARGS() in xlogreader.c. 6f6f284 has introdu= ced a specific macro to make printf()-ing of LSNs easier. This takes care of w= hat looks like the remaining code paths that did not get the call. Author: Michael Paquier Reviewed-by: Kyotaro Horiguchi, Tom Lane Discussion: [https://postgr.es/m/YIJS9x6K8ruizN7j@paquier.xyz](https://postgr.es/m/YI= JS9x6K8ruizN7j@paquier.xyz) [https://git.postgresql.org/pg/commitdiff/4aba61b87026b43fb37fc8e9ec5d9ae= 208e07b6b](https://git.postgresql.org/pg/commitdiff/4aba61b87026b43fb37fc8e= 9ec5d9ae208e07b6b) - Doc: Remove extraneous whitespaces with some tags. Author: Justin Pryzby Discussion: [https://postgr.es/m/20210423184338.GL7256@telsasoft.com](https://postgr.= es/m/20210423184338.GL7256@telsasoft.com) [https://git.postgresql.org/pg/commitdiff/0d0049c58b4970183a102fc1f7dc1e9= bef2a7149](https://git.postgresql.org/pg/commitdiff/0d0049c58b4970183a102fc= 1f7dc1e9bef2a7149) - Fix come comments in execMain.c. 1375422 has refactored this area of the executor code, and some comments went out-of-sync. Author: Yukun Wang Reviewed-by: Amul Sul Discussion: [https://postgr.es/m/OS0PR01MB60033394FCAEF79B98F078F5B4459@OS0PR01MB6003= .jpnprd01.prod.outlook.com](https://postgr.es/m/OS0PR01MB60033394FCAEF79B98= F078F5B4459@OS0PR01MB6003.jpnprd01.prod.outlook.com) [https://git.postgresql.org/pg/commitdiff/9b5558e7ad4706bbd53947e5b4d7c06= e150390a5](https://git.postgresql.org/pg/commitdiff/9b5558e7ad4706bbd53947e= 5b4d7c06e150390a5) Amit Kapila pushed: - Fix test case added by commit f5fc2f5b23. In the new test after resetting= the stats, we were not waiting for the stats message to be delivered. Also, we need to decode the results for the new test, otherwise, it will show the = old stats. In passing, a. Change docs added by commit f5fc2f5b23 as per suggestion by Justin Pryzby. b. Bump the PGSTAT_FILE_FORMAT_ID as commit f5fc2f5b23 changes the file format of stats. Reported-by: Tom Lane based= on buildfarm reports Author: Vignesh C, Justin Pryzby Reviewed-by: Amit Kapi= la Discussion: [https://postgr.es/m/20210319185247.ldebgpdaxsowiflw@alap3.anarazel.de](h= ttps://postgr.es/m/20210319185247.ldebgpdaxsowiflw@alap3.anarazel.de) [https://git.postgresql.org/pg/commitdiff/c64dcc7fee5f8a7941a4fd098a969de= 1f457cc79](https://git.postgresql.org/pg/commitdiff/c64dcc7fee5f8a7941a4fd0= 98a969de1f457cc79) Peter Eisentraut pushed: - Use correct format placeholder for pids. Should be signed, not unsigned. [https://git.postgresql.org/pg/commitdiff/640b91c3ed24002b34c7226fb51ef91= 76fb72713](https://git.postgresql.org/pg/commitdiff/640b91c3ed24002b34c7226= fb51ef9176fb72713) - Don't use INT64_FORMAT inside message strings. Use %lld and cast to long = long int instead. [https://git.postgresql.org/pg/commitdiff/3286065651477c2060910dfb42b3ced= bd79a7980](https://git.postgresql.org/pg/commitdiff/3286065651477c2060910df= b42b3cedbd79a7980) - Fix typo. [https://git.postgresql.org/pg/commitdiff/f0ec598b4323d8b29df5c67f2cd0000= 547a507ed](https://git.postgresql.org/pg/commitdiff/f0ec598b4323d8b29df5c67= f2cd0000547a507ed) - doc: Improve hyphenation consistency. [https://git.postgresql.org/pg/commitdiff/544b28088f9d41750ccf193812da62b= dfe4bd98a](https://git.postgresql.org/pg/commitdiff/544b28088f9d41750ccf193= 812da62bdfe4bd98a) - Use correct format placeholder for timeline IDs. Should be %u rather than= %d. [https://git.postgresql.org/pg/commitdiff/39d0928a0e88426ee64189898565c40= d4af9ad96](https://git.postgresql.org/pg/commitdiff/39d0928a0e88426ee641898= 98565c40d4af9ad96) - Add DISTINCT to information schema usage views. Since pg_depend can conta= in duplicate entries, we need to eliminate those in information schema views= that build on pg_depend, using DISTINCT. Some of the older views already did = that correctly, but some of the more recently added ones didn't. (In some of = these views, it might not be possible to reproduce the issue because of how the implementation happens to deduplicate dependencies while recording them, = but it seems better to keep this consistent in all cases.) [https://git.postgresql.org/pg/commitdiff/d84ffffe582b8e036a14c6bc2378df2= 9167f3a00](https://git.postgresql.org/pg/commitdiff/d84ffffe582b8e036a14c6b= c2378df29167f3a00) - Update config.guess and config.sub. [https://git.postgresql.org/pg/commitdiff/26ac261ee4033710cad44f7924d5375= 3129b60c7](https://git.postgresql.org/pg/commitdiff/26ac261ee4033710cad44f7= 924d53753129b60c7) - Fix some trailing whitespace in documentation files. [https://git.postgresql.org/pg/commitdiff/197d33ccbe888fc84ae4e49bb241e88= ea3c81f15](https://git.postgresql.org/pg/commitdiff/197d33ccbe888fc84ae4e49= bb241e88ea3c81f15) - Fix incorrect format placeholder. [https://git.postgresql.org/pg/commitdiff/7776a23a4bdeb7215e4f8ddea5989cb= 143becc12](https://git.postgresql.org/pg/commitdiff/7776a23a4bdeb7215e4f8dd= ea5989cb143becc12) - doc: Fix typos. Author: Justin Pryzby [https://git.postgresql.org/pg/commitdiff/9bd563aa9f0694994a6640946a7ee3d= c0431d507](https://git.postgresql.org/pg/commitdiff/9bd563aa9f0694994a66409= 46a7ee3dc0431d507) - pg_amcheck: Use logging functions. This was already mostly done, but some error messages were printed the long way. [https://git.postgresql.org/pg/commitdiff/add5fad78aac8da96aeeb730155d35b= 16ff9b55a](https://git.postgresql.org/pg/commitdiff/add5fad78aac8da96aeeb73= 0155d35b16ff9b55a) - Use correct format placeholder for WSAGetLastError(). Some code thought t= his was unsigned, but it's signed int. [https://git.postgresql.org/pg/commitdiff/9486844f301e265a3ad11b612decaba= 2462c3c15](https://git.postgresql.org/pg/commitdiff/9486844f301e265a3ad11b6= 12decaba2462c3c15) - Factor out system call names from error messages. Instead, put them in vi= a a format placeholder. This reduces the number of distinct translatable mes= sages and also reduces the chances of typos during translation. We already did= this for the system call arguments in a number of cases, so this is just the s= ame thing taken a bit further. Discussion: [https://www.postgresql.org/message-id/flat/92d6f545-5102-65d8-3c87-489f7= 1ea0a37%40enterprisedb.com](https://www.postgresql.org/message-id/flat/92d6= f545-5102-65d8-3c87-489f71ea0a37%40enterprisedb.com) [https://git.postgresql.org/pg/commitdiff/82c3cd974131d7fa1cfcd07cebfb04f= ffe26ee35](https://git.postgresql.org/pg/commitdiff/82c3cd974131d7fa1cfcd07= cebfb04fffe26ee35) Peter Geoghegan pushed: - Document LP_DEAD accounting issues in VACUUM. Document VACUUM's soft assumption that any LP_DEAD items encountered during pruning will become LP_UNUSED items before VACUUM finishes up. This is integral to the accoun= ting used by VACUUM to generate its final report on the table to the stats collector. It also affects how VACUUM determines which heap pages are truncatable. In both cases VACUUM is concerned with the likely contents = of the page in the near future, not the current contents of the page. This = state of affairs created the false impression that VACUUM's dead tuple accounti= ng had significant difference with similar accounting used during ANALYZE. = There were and are no substantive differences, at least when the soft assumption completely works out. This is far clearer now. Also document cases where things don't quite work out for VACUUM's dead tuple accounting. It's pos= sible that a significant number of LP_DEAD items will be left behind by VACUUM,= and won't be recorded as remaining dead tuples in VACUUM's statistics collect= or report. This behavior dates back to commit a96c41fe, which taught VACUUM= to run without index and heap vacuuming at the user's request. The failsafe mechanism added to VACUUM more recently by commit 1e55e7d1 takes the same approach to dead tuple accounting. Reported-By: Masahiko Sawada Discussion: [https://postgr.es/m/CAH2-Wz=3DJmtu18PrsYq3EvvZJGOmZqSO2u3bvKpx9xJa5uhNp= =3DQ@mail.gmail.com](https://postgr.es/m/CAH2-Wz=3DJmtu18PrsYq3EvvZJGOmZqSO= 2u3bvKpx9xJa5uhNp=3DQ@mail.gmail.com) [https://git.postgresql.org/pg/commitdiff/7136bf34f28892362144ae2e3507148= 36a5c0c0c](https://git.postgresql.org/pg/commitdiff/7136bf34f28892362144ae2= e350714836a5c0c0c) - amcheck: MAXALIGN() nbtree special area offset. This isn't strictly necessary, but in theory it might matter if in the future the width of the nbtree special area changes -- its total size might not be an even number= of MAXALIGN() quantums, even with padding. PageInit() MAXALIGN()s all special area offsets, but amcheck uses the offset to perform initial basic valida= tion of line pointers, so we don't rely on the offset from the page header. T= he real reason to do this is to set a good example for new code that adds am= check coverage for other index AMs. Reported-By: Bharath Rupireddy Discussion: [https://postgr.es/m/CALj2ACUMqTR9nErh99FbOBmzCXE9=3DgXNqhBiwYOhejJJS1LXq= Q@mail.gmail.com](https://postgr.es/m/CALj2ACUMqTR9nErh99FbOBmzCXE9=3DgXNqh= BiwYOhejJJS1LXqQ@mail.gmail.com) [https://git.postgresql.org/pg/commitdiff/bb3ecc8c961896ecb2ad3d5ba705c28= 77b933945](https://git.postgresql.org/pg/commitdiff/bb3ecc8c961896ecb2ad3d5= ba705c2877b933945) Magnus Hagander pushed: - Fix typo in comment. Author: Julien Rouhaud Backpatch-through: 11 Discuss= ion: [https://postgr.es/m/20210420121659.odjueyd4rpilorn5@nol](https://postgr.= es/m/20210420121659.odjueyd4rpilorn5@nol) [https://git.postgresql.org/pg/commitdiff/8b4b5669cde2b17bd6b5d68f584d970= 78f3296ac](https://git.postgresql.org/pg/commitdiff/8b4b5669cde2b17bd6b5d68= f584d97078f3296ac) - Mention that toplevel is part of pg_stat_statements key. While at it, also document that toplevel is always true if pg_stat_statements.track is set = to top. Author: Julien Rouhaud Reported-By: Fujii Masao Discussion: [https://postgr.es/m/a878d5ea-64a7-485e-5d2f-177618ebc52d@oss.nttdata.com= ](https://postgr.es/m/a878d5ea-64a7-485e-5d2f-177618ebc52d@oss.nttdata.com) [https://git.postgresql.org/pg/commitdiff/7531fcb1fcf5b3ea2f49959a3f095c0= 83e3fc4c4](https://git.postgresql.org/pg/commitdiff/7531fcb1fcf5b3ea2f49959= a3f095c083e3fc4c4) Andrew Dunstan pushed: - Avoid unfortunate IPC::Run path caching in PostgresNode. Commit b34ca595ab provided for installation-aware instances of PostgresNode. However, it tu= rns out that IPC::Run works against this by caching the path to a binary and = not consulting the path again, even if it has changed. We work around this by calling Postgres binaries with the installed path rather than just a bare= name to be looked up in the environment path, if there is an installed path. F= or the common case where there is no installed path we continue to use the b= are command name. Diagnosis and solution from Mark Dilger Discussion: [https://postgr.es/m/E8F512F8-B4D6-4514-BA8D-2E671439DA92@enterprisedb.co= m](https://postgr.es/m/E8F512F8-B4D6-4514-BA8D-2E671439DA92@enterprisedb.co= m) [https://git.postgresql.org/pg/commitdiff/95c3a1956ec9eac686c1b69b033dd79= 211b72343](https://git.postgresql.org/pg/commitdiff/95c3a1956ec9eac686c1b69= b033dd79211b72343) - Only ever test for non-127.0.0.1 addresses on Windows in PostgresNode. Th= is has been found to cause hangs where tcp usage is forced. Alexey Kodratov Discussion: [https://postgr.es/m/82e271a9a11928337fcb5b5e57b423c0@postgrespro.ru](htt= ps://postgr.es/m/82e271a9a11928337fcb5b5e57b423c0@postgrespro.ru) Backpatch to all live branches [https://git.postgresql.org/pg/commitdiff/d064afc7204b52cb78a83fea0e68669= 3ce5ba00c](https://git.postgresql.org/pg/commitdiff/d064afc7204b52cb78a83fe= a0e686693ce5ba00c) - fix silly perl error in commit d064afc720. [https://git.postgresql.org/pg/commitdiff/e014d25deade08df082d2b37de45adb= 0c984f563](https://git.postgresql.org/pg/commitdiff/e014d25deade08df082d2b3= 7de45adb0c984f563) - Make PostgresNode version aware. A new PostgresVersion object type is cre= ated 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 compare= d 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](h= ttps://postgr.es/m/a80421c0-3d7e-def1-bcfe-24777f15e344@dunslane.net) [https://git.postgresql.org/pg/commitdiff/4c4eaf3d19201c5e2d9efebc590903d= faba0d3e5](https://git.postgresql.org/pg/commitdiff/4c4eaf3d19201c5e2d9efeb= c590903dfaba0d3e5) - Make PostgresVersion code a bit more robust and simple. per gripe from Al= varo Herrera. [https://git.postgresql.org/pg/commitdiff/502dc6df8f6eeba06812ce09488efc7= e684f5ec9](https://git.postgresql.org/pg/commitdiff/502dc6df8f6eeba06812ce0= 9488efc7e684f5ec9) - Teach PostgresVersion all the ways to mark non-release code. As well as 'devel' version_stamp.pl provides for 'alphaN' 'betaN' and 'rcN', so teach PostgresVersion about those. Also stash the version string instead of tr= ying to reconstruct it during stringification. Discussion: [https://postgr.es/m/YIHlw5nSgAHs4dK1@paquier.xyz](https://postgr.es/m/YI= Hlw5nSgAHs4dK1@paquier.xyz) [https://git.postgresql.org/pg/commitdiff/aa271209f6d995488fc5cba9731415f= 974823990](https://git.postgresql.org/pg/commitdiff/aa271209f6d995488fc5cba= 9731415f974823990) - Provide pg_amcheck with an --install-missing option. This will install am= check in the database if not present. The default schema is for the extension is pg_catalog, but this can be overridden by providing a value for the optio= n. Mark Dilger, slightly editorialized by me. (rather divergent) Discussion: [https://postgr.es/m/bdc0f7c2-09e3-ee57-8471-569dfb509234@dunslane.net](h= ttps://postgr.es/m/bdc0f7c2-09e3-ee57-8471-569dfb509234@dunslane.net) [https://git.postgresql.org/pg/commitdiff/b859d94c638968ccbb517ac7e151bdd= 94ed7c16a](https://git.postgresql.org/pg/commitdiff/b859d94c638968ccbb517ac= 7e151bdd94ed7c16a) Tom Lane pushed: - Fix planner failure in some cases of sorting by an aggregate. An oversight introduced by the incremental-sort patches caused "could not find pathkey= item to sort" errors in some situations where a sort key involves an aggregate= or window function. The basic problem here is that find_em_expr_usable_for_sorting_rel isn't properly modeling what prepare_sort_from_pathkeys will do later. Rather than hoping we can keep those functions in sync, let's refactor so that they actually share the c= ode for identifying a suitable sort expression. With this refactoring, tlist= .c's tlist_member_ignore_relabel is unused. I removed it in HEAD but left it = in place in v13, in case any extensions are using it. Per report from Luc Vlaming. Back-patch to v13 where the problem arose. James Coleman and T= om Lane Discussion: [https://postgr.es/m/91f3ec99-85a4-fa55-ea74-33f85a5c651f@swarm64.com](ht= tps://postgr.es/m/91f3ec99-85a4-fa55-ea74-33f85a5c651f@swarm64.com) [https://git.postgresql.org/pg/commitdiff/375398244168add84a884347625d145= 81a421e71](https://git.postgresql.org/pg/commitdiff/375398244168add84a88434= 7625d14581a421e71) - Rename find_em_expr_usable_for_sorting_rel. I didn't particularly like th= is function name, as it fails to express what's going on. Also, returning t= he sort expression alone isn't too helpful --- typically, a caller would also need some other fields of the EquivalenceMember. But the sole caller rea= lly only needs a bool result, so let's make it "bool relation_can_be_sorted_early()". Discussion: [https://postgr.es/m/91f3ec99-85a4-fa55-ea74-33f85a5c651f@swarm64.com](ht= tps://postgr.es/m/91f3ec99-85a4-fa55-ea74-33f85a5c651f@swarm64.com) [https://git.postgresql.org/pg/commitdiff/7645376774c8532159f5f0f905e5e73= 4d4ccbb18](https://git.postgresql.org/pg/commitdiff/7645376774c8532159f5f0f= 905e5e734d4ccbb18) - Fix under-parenthesized XLogRecHasBlockRef() macro. Commit f003d9f87 left= this macro with inadequate (or, one could say, too much) parenthesization. Wh= ich was catastrophic to the correctness of calls such as "if (!XLogRecHasBlockRef(record, 1)) ...". There are only a few of those, wh= ich perhaps explains why we didn't notice immediately (with our general weakn= ess of WAL replay testing being another factor). I found it by debugging intermittent replay failures like 2021-04-08 14:33:30.191 EDT [29463] PA= NIC: failed to locate backup block with ID 1 2021-04-08 14:33:30.191 EDT [2946= 3] CONTEXT: WAL redo at 0/95D3438 for SPGist/ADD_NODE: off 1; blkref #0: rel 1663/16384/25998, blk 1 [https://git.postgresql.org/pg/commitdiff/9e41148229192dccc4bcc40f53af588= b73d8ffea](https://git.postgresql.org/pg/commitdiff/9e41148229192dccc4bcc40= f53af588b73d8ffea) - Improve WAL record descriptions for SP-GiST records. While tracking down = the bug fixed in the preceding commit, I got quite annoyed by the low quality= of spg_desc's output. Add missing fields, try to make the formatting consis= tent. [https://git.postgresql.org/pg/commitdiff/783be78ca91166ac7f80c953f2bbc5a= f1f61c6cd](https://git.postgresql.org/pg/commitdiff/783be78ca91166ac7f80c95= 3f2bbc5af1f61c6cd) - Doc: document the tie-breaking behavior of the round() function. Back-pat= ch to v13; the table layout in older branches is unfriendly to adding such deta= ils. Laurenz Albe Discussion: [https://postgr.es/m/161881920775.685.12293798764864559341@wrigleys.postg= resql.org](https://postgr.es/m/161881920775.685.12293798764864559341@wrigle= ys.postgresql.org) [https://git.postgresql.org/pg/commitdiff/82b13dbc4d4b46f71ca95ce1cc15c42= 5deff5957](https://git.postgresql.org/pg/commitdiff/82b13dbc4d4b46f71ca95ce= 1cc15c425deff5957) - Don't crash on reference to an un-available system column. Adopt a more consistent policy about what slot-type-specific getsysattr functions shou= ld 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 commi= ts a71cfc56b and 3fb93103a (in v13 and v12), so back-patch into those branch= es, 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](https://postgr.es/m/= 141051591267657@mail.yandex.ru) [https://git.postgresql.org/pg/commitdiff/d479d00285255d422a2b38f1cfaa358= 08968a08c](https://git.postgresql.org/pg/commitdiff/d479d00285255d422a2b38f= 1cfaa35808968a08c) Bruce Momjian pushed: - adjust query id feature to use pg_stat_activity.query_id. Previously, it = was pg_stat_activity.queryid to match the pg_stat_statements queryid column. = This is an adjustment to patch 4f0b0966c8. This also adjusts some of the inte= rnal function calls to match. Catversion bumped. Reported-by: =C3=81lvaro He= rrera, Julien Rouhaud Discussion: [https://postgr.es/m/20210408032704.GA7498@alvherre.pgsql](https://postgr= .es/m/20210408032704.GA7498@alvherre.pgsql) [https://git.postgresql.org/pg/commitdiff/9660834dd8bf5b093f7b49eef846666= 201d45a35](https://git.postgresql.org/pg/commitdiff/9660834dd8bf5b093f7b49e= ef846666201d45a35) - Fix interaction of log_line_prefix's query_id and log_statement. log_stat= ement is issued before query_id can be computed, so properly clear the value, a= nd document the interaction. Reported-by: Fujii Masao, Michael Paquier Discussion: [https://postgr.es/m/YHPkU8hFi4no4NSw@paquier.xyz](https://postgr.es/m/YH= PkU8hFi4no4NSw@paquier.xyz) Author: Julien Rouhaud [https://git.postgresql.org/pg/commitdiff/db01f797dd48f826c62e1b8eea70f11= fe7ff3efc](https://git.postgresql.org/pg/commitdiff/db01f797dd48f826c62e1b8= eea70f11fe7ff3efc) - doc: mention can be inside of , but not . This was discussed in commit 9081bddbd. Reported-by: Peter Eisentraut Discussion: [https://postgr.es/m/flat/87o8pco34z.fsf@wibble.ilmari.org](https://postg= r.es/m/flat/87o8pco34z.fsf@wibble.ilmari.org) [https://git.postgresql.org/pg/commitdiff/84f15ccd4c25c4ffc4de6ed82f7658a= 3a199a1d7](https://git.postgresql.org/pg/commitdiff/84f15ccd4c25c4ffc4de6ed= 82f7658a3a199a1d7) =C3=81lvaro Herrera pushed: - Don't add a redundant constraint when detaching a partition. On ALTER TAB= LE .. DETACH CONCURRENTLY, we add a new table constraint that duplicates the partition constraint. But if the partition already has another constraint that implies that one, then that's unnecessary. We were already avoiding = the addition of a duplicate constraint if there was an exact 'equal' match --= this just improves the quality of the check. Author: Justin Pryzby Reviewed-by: =C3=81lvaro Herrera Discussion: [https://postgr.es/m/20210410184226.GY6592@telsasoft.com](https://postgr.= es/m/20210410184226.GY6592@telsasoft.com) [https://git.postgresql.org/pg/commitdiff/7b357cc6ae553c0ecacdc11b2e5278b= 7bf477dba](https://git.postgresql.org/pg/commitdiff/7b357cc6ae553c0ecacdc11= b2e5278b7bf477dba) - Add comment about extract_autovac_opts not holding lock. Per observation = from Tom Lane. Discussion: [https://postgr.es/m/1901125.1617904665@sss.pgh.pa.us](https://postgr.es/= m/1901125.1617904665@sss.pgh.pa.us) [https://git.postgresql.org/pg/commitdiff/7c298c6573a0f181963ddcb40c850fa= 9c7da0ada](https://git.postgresql.org/pg/commitdiff/7c298c6573a0f181963ddcb= 40c850fa9c7da0ada) - Fix relcache inconsistency hazard in partition detach. During queries com= ing from ri_triggers.c, we need to omit partitions that are marked pending de= tach -- otherwise, the RI query is tricked into allowing a row into the refere= ncing table whose corresponding row is in the detached partition. Which is bog= us: 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 include= d). When a partdesc-without- detached-partitions is requested, we create one afresh each time; also, those partdescs are stored in PortalContext inste= ad 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() argu= ments 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 outpu= t of that test was bogus. This commit also corrects that expected output. Au= thor: Amit Langote Author: =C3=81lvaro Herrera Discussion: [https://postgr.es/m/3269784.1617215412@sss.pgh.pa.us](https://postgr.es/= m/3269784.1617215412@sss.pgh.pa.us) [https://git.postgresql.org/pg/commitdiff/8aba9322511f718f12b618470d8c07f= 0ee5f0700](https://git.postgresql.org/pg/commitdiff/8aba9322511f718f12b6184= 70d8c07f0ee5f0700) - Fix uninitialized memory bug. 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). [https://git.postgresql.org/pg/commitdiff/43b55ec4bc3bc06596d966391f16def= e016310ec](https://git.postgresql.org/pg/commitdiff/43b55ec4bc3bc06596d9663= 91f16defe016310ec) Etsuro Fujita pushed: - Minor code cleanup in asynchronous execution support. This is cleanup for commit 27e1f1456: * ExecAppendAsyncEventWait(), which was modified a bit further by commit a8af856d3, duplicated the same nevents calculation. Simplify the code a little bit to avoid the duplication. Update commen= ts there. * Add an assertion to ExecAppendAsyncRequest(). * Update a comment about merging the async_capable options from input relations in merge_fdw_options(), per complaint from Kyotaro Horiguchi. * Add a commen= t for fetch_more_data_begin(). Author: Etsuro Fujita Discussion: [https://postgr.es/m/CAPmGK1637W30Wx3MnrReewhafn6F_0J76mrJGoFXFnpPq4QfvA%= 40mail.gmail.com](https://postgr.es/m/CAPmGK1637W30Wx3MnrReewhafn6F_0J76mrJ= GoFXFnpPq4QfvA%40mail.gmail.com) [https://git.postgresql.org/pg/commitdiff/bb684c82f73316b88f9bcb321128a43= 47b5206fe](https://git.postgresql.org/pg/commitdiff/bb684c82f73316b88f9bcb3= 21128a4347b5206fe) Fujii Masao pushed: - doc: Fix obsolete description about pg_basebackup. Previously it was documented that if using "-X none" option there was no guarantee that all required WAL files were archived at the end of pg_basebackup when taking a backup from the standby. But this limitation was removed by commit 52f8a5= 9dd9. Now, even when taking a backup from the standby, pg_basebackup can wait f= or all required WAL files to be archived. Therefore this commit removes such obsolete description from the docs. Also this commit adds new description about the limitation when taking a backup from the standby, into the docs= . The limitation is that pg_basebackup cannot force the standbfy to switch to a= new WAL file at the end of backup, which may cause pg_basebackup to wait a lo= ng time for the last required WAL file to be switched and archived, especial= ly when write activity on the primary is low. Back-patch to v10 where the i= ssue was introduced. Reported-by: Kyotaro Horiguchi Author: Kyotaro Horiguchi, Fujii Masao Reviewed-by: Kyotaro Horiguchi, Fujii Masao Discussion: [https://postgr.es/m/20210420.133235.1342729068750553399.horikyota.ntt@gm= ail.com](https://postgr.es/m/20210420.133235.1342729068750553399.horikyota.= ntt@gmail.com) [https://git.postgresql.org/pg/commitdiff/eaec48b3c54eec222d64468b57af80e= e4ddf76a9](https://git.postgresql.org/pg/commitdiff/eaec48b3c54eec222d64468= b57af80ee4ddf76a9) - Reorder COMPRESSION option in gram.y and parsenodes.h into alphabetical o= rder. Commit bbe0a81db6 introduced "INCLUDING COMPRESSION" option in CREATE TAB= LE command, but previously TableLikeOption in gram.y and parsenodes.h didn't classify this new option in alphabetical order with the rest. Author: Fu= jii Masao Reviewed-by: Michael Paquier Discussion: [https://postgr.es/m/YHerAixOhfR1ryXa@paquier.xyz](https://postgr.es/m/YH= erAixOhfR1ryXa@paquier.xyz) [https://git.postgresql.org/pg/commitdiff/3f20d5f37086e548c32ddb9d6ae09c2= e1ce300ce](https://git.postgresql.org/pg/commitdiff/3f20d5f37086e548c32ddb9= d6ae09c2e1ce300ce) Alexander Korotkov pushed: - Mark multirange_constructor0() and multirange_constructor2() strict. These functions shouldn't receive null arguments: multirange_constructor0() doe= sn't have any arguments while multirange_constructor2() has a single array argument, which is never null. But mark them strict anyway for the sake = of uniformity. Also, make checks for null arguments use elog() instead of ereport() as these errors should normally be never thrown. And adjust corresponding comments. Catversion is bumped. Reported-by: Peter Eisent= raut Discussion: [https://postgr.es/m/0f783a96-8d67-9e71-996b-f34a7352eeef%40enterprisedb.= com](https://postgr.es/m/0f783a96-8d67-9e71-996b-f34a7352eeef%40enterprised= b.com) [https://git.postgresql.org/pg/commitdiff/6bbcff096f932a1fe43ac3208c5c8b0= acac29cda](https://git.postgresql.org/pg/commitdiff/6bbcff096f932a1fe43ac32= 08c5c8b0acac29cda) Noah Misch pushed: - Make a test endure log_error_verbosity=3Dverbose. [https://git.postgresql.org/pg/commitdiff/59773da2b132ced19c84ff1f69b53b5= cf95fd69e](https://git.postgresql.org/pg/commitdiff/59773da2b132ced19c84ff1= f69b53b5cf95fd69e) # Pending Patches Peter Smith sent in a patch to rearrange the option list for CREATE SUBSCRIPTION. Bharath Rupireddy sent in another revision of a patch to add new table AMs = for multi- and single- inserts, and use same for CTAS, REFRESH MATERIALIZED VIE= W, and COPY. Amul Sul sent in two more revisions of a patch to remove a redundant variab= le from transformCreateStmt. Pavel St=C4=9Bhule sent in another revision of a patch to make it possible = to log seqscans in auto_explain. David Rowley sent in another revision of a patch to reduce the number of co= ntrib build special cases on Windows. Amul Sul sent in two more revisions of a patch to add a RelationGetSmgr inl= ine function. Masahiko Sawada sent in two more revisions of a patch to skip vmbuffer for frozen tuple insertion. Dagfinn Ilmari Manns=C3=A5ker sent in a patch to create a function for stri= pping RelabelType nodes off an expression, consolidating many repetitions of the = same pattern into one. Masahiko Sawada and Amit Kapila traded patches to use HTAB for replication = slot statistics. Vigneshwaran C and Amit Kapila traded patches to update decoding stats duri= ng replication slot release. Bharath Rupireddy sent in a patch to use WaitLatches for lock waiting in lazy_truncate_heap, in do_pg_stop_backup instead of a pg_usleep(), and for = pre- and post- auth delay. Bharath Rupireddy sent in a patch to move the parallel_leader_participation= GUC to the resource consumption category. Peter Smith sent in two more revisions of a patch to add support for prepar= ed transactions to built-in logical replication, and add prepare API support f= or streaming transactions. Dan Carter sent in a patch to add a GSSAPI ccache_name option to libpq. Takamichi Osumi and Amit Kapila traded patches to fix an infelicity between TRUNCATE and synchronous logical replication. Amit Langote sent in a patch to fix a tupdesc leak in the pgoutput plugin. Bharath Rupireddy sent in a patch to skip VACUUM/ANALYZE of repeated relati= ons. Pavel St=C4=9Bhule sent in another revision of a patch to add a PSQL_WATCH_= PAGER setting to psql. Masahiro Ikeda sent in another revision of a patch to make some performance improvements in reporting WAL stats without introducing a new variable. Fujii Masao sent in four more revisions of a patch to document the way TRUN= CATE works on foreign tables, and ensure that any ONLY clauses in the original q= uery not be passed to same. Hou Zhijie sent in a patch to fix a test case with the wrong parallel safety flag. Zeng Wenjing sent in another revision of a patch to implement global tempor= ary tables. Simon Riggs sent in a patch to document the fact that altering a constraint= to VALIDATE it requires a SHARE UPDATE EXCLUSIVE lock. Simon Riggs sent in a patch to reduce the lock level for CHECK constraints = when allowing them to be NOT VALID. Daniil Zakhlystov sent in another revision of a patch to add zlib and zstd streaming compression, and implement libpq compression. Tom Lane sent in a patch to document Julian dates better. =C3=81lvaro Herrera sent in a patch to add tab-complete for ALTER TABLE .. = DETACH PARTITION CONCURRENTLY to psql. Tom Stellard sent in a patch to jit to work around a potential data layout mismatch on s390x. Justin Pryzby sent in a patch to add COMPRESSION as a possibility when exec= uting CREATE TABLE ... LIKE. Kyotaro HORIGUCHI sent in a patch to fix up some dubious messages. Tang sent in a patch to use pg_strncasecmp to replace strncmp when comparing things "pg_" in psql. Tang sent in another revision of a patch to support tab completion for upper case character inputs in psql. Hou Zhijie sent in another revision of a patch to make it possible to execu= te INSERT SELECT in parallel. Mark Dilger and Robert Haas traded patches to add toast pointer corruption checks to pg_amcheck. Bharath Rupireddy sent in a patch to MAXALIGN sizeof(BTPageOpaqueData) in PageGetItemIdCareful. Ajin Cherian sent in another revision of a patch to skip empty transactions= for logical replication. Alexander Pyhalov sent in another revision of a patch to push down restrict= infos to CTEs, and attempt to prune partitions in the process. Thomas Munro sent in a patch to add a new TAP test under src/test/recovery = that runs the regression tests with wal_consistency_checking=3Dall. Joel Jacobson sent in a patch to fix pg_identify_object_as_address for event triggers. Takamichi Osumi sent in a patch to replace the check of RelationIsLogicallyLogged in ReorderBufferProcessTXN with an Assert to the = same effect. David Rowley sent in another revision of a patch to speed up NOT IN() with = a set of Consts by allowing hash tables to be used. David Rowley and Yura Sokolov traded patches to use simplehash.h instead of dynahash in SMgr. Julien Rouhaud sent in a patch to fix some oversights in query_id calculati= on. Tom Lane sent in a patch to make it required for callers of pq_getmessage to provide an upper length bound, and installs the same sort of short-vs-long message heuristic as libpq has in the server. --===============4183336256831844997== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable PostgreSQL Weekly News - April 25, 2021
 

PostgreSQL Weekly News - April 25, 2021

PostgreSQL Weekly News - April 25, 2021

Person of the week: https://postgresql.life/post/pavlo_golub/

PostgreSQL Product News

JDBC 42.2.20 released https://jdbc.postgresql.org/documentation/changelog.html#version_42.2.20

kubgres 1.1, a Kubernetes operator which ma= kes it possible to deploy a cluster of PostgreSQL pods with replication and failover configured, released. https://github.com/reacti= ve-tech/kubegres/releases/tag/v1.1

pspg 4.6.1 a pager designed for PostgreSQL,= released. https://github.com/okbob/pspg/releases/tag/4.6.1

pgAdmin4 5.2, a web- and native GUI control= center for PostgreSQL, released. https://www.pgadmin.org/docs/pgadmin4/5.2/release_notes_5_2.html

pg_log_statements 0.2, an extension that ma= kes is possible to log statements for specific server processes, released. https://github.com/pier= reforstmann/pg_log_statements/releases

PostgreSQL Jobs for April

h= ttps://archives.postgresql.org/pgsql-jobs/2021-04/

PostgreSQL in the News

Planet PostgreSQL: htt= ps://planet.postgresql.org/

PostgreSQL Weekly News is brought to you th= is week by David Fetter

Submit news and announcements by Sunday at = 3:00pm PST8PDT to david@fetter.org.

Applied Patches

Thomas Munro pushed:

Micha=C3=ABl Paquier pushed:

Amit Kapila pushed:

Peter Eisentraut pushed:

Peter Geoghegan pushed:

  • Document LP_DEAD accounting issues in VACUU= M. Document VACUUM's soft assumption that any LP_DEAD items encountered during pruning will become LP_UNUSED items before VACUUM finishes up. This is integral to the accoun= ting used by VACUUM to generate its final report on the table to the stats collector. It also affects how VACUUM determines which heap pages are truncatable. In both cases VACUUM is concerned with the likely contents = of the page in the near future, not the current contents of the page. This = state of affairs created the false impression that VACUUM's dead tuple accounti= ng had significant difference with similar accounting used during ANALYZE. = There were and are no substantive differences, at least when the soft assumption completely works out. This is far clearer now. Also document cases where things don't quite work out for VACUUM's dead tuple accounting. It's pos= sible that a significant number of LP_DEAD items will be left behind by VACUUM,= and won't be recorded as remaining dead tuples in VACUUM's statistics collect= or report. This behavior dates back to commit a96c41fe, which taught VACUUM= to run without index and heap vacuuming at the user's request. The failsafe mechanism added to VACUUM more recently by commit 1e55e7d1 takes the same approach to dead tuple accounting. Reported-By: Masahiko Sawada saw= ada.mshk@gmai&#= 108;.com Discussion: https://postgr.es/m/CAH2-Wz=3DJmtu18PrsYq3EvvZJGOmZqSO2u3bvKpx9xJa5= uhNp=3DQ@mail.gmail.com htt= ps://git.postgresql.org/pg/commitdiff/7136bf34f28892362144ae2e350714836a5c0= c0c

  • amcheck: MAXALIGN() nbtree special area of= fset. This isn't strictly necessary, but in theory it might matter if in the future the width of the nbtree special area changes -- its total size might not be an even number= of MAXALIGN() quantums, even with padding. PageInit() MAXALIGN()s all special area offsets, but amcheck uses the offset to perform initial basic valida= tion of line pointers, so we don't rely on the offset from the page header. T= he real reason to do this is to set a good example for new code that adds am= check coverage for other index AMs. Reported-By: Bharath Rupireddy bha&= #114;ath.rupiredd= yforpostgres= 4;gmail.com Discussion: https://postgr.es/m/CALj2ACUMqTR9nErh99FbOBmzCXE9=3DgXNqhBiwYOhejJJS1= LXqQ@mail.gmail.com htt= ps://git.postgresql.org/pg/commitdiff/bb3ecc8c961896ecb2ad3d5ba705c2877b933= 945

Magnus Hagander pushed:

Andrew Dunstan pushed:

Tom Lane pushed:

Bruce Momjian pushed:

=C3=81lvaro Herrera pushed:

  • Don't add a redundant constraint when detac= hing a partition. On ALTER TABLE .. DETACH CONCURRENTLY, we add a new table constraint that duplicates the partition constraint. But if the partition already has another constraint that implies that one, then that's unnecessary. We were already avoiding = the addition of a duplicate constraint if there was an exact 'equal' match --= this just improves the quality of the check. Author: Justin Pryzby pry= ;zby@telsasoft= ;.com Reviewed-by: =C3=81lvaro Herrera alvhe = 4;re@alvh.no-ip= ;.org Discussion: https://postgr.es/m/2021041= 0184226.GY6592@telsasoft.com htt= ps://git.postgresql.org/pg/commitdiff/7b357cc6ae553c0ecacdc11b2e5278b7bf477= dba

  • Add comment about extract_autovac_opts not = holding lock. Per observation from Tom Lane. Discussion: https://postgr.es/m/1901125.16= 17904665@sss.pgh.pa.us htt= ps://git.postgresql.org/pg/commitdiff/7c298c6573a0f181963ddcb40c850fa9c7da0= ada

  • Fix relcache inconsistency hazard in partit= ion detach. During queries coming from ri_triggers.c, we need to omit partitions that are marked pending de= tach -- otherwise, the RI query is tricked into allowing a row into the refere= ncing table whose corresponding row is in the detached partition. Which is bog= us: 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 include= d). When a partdesc-without- detached-partitions is requested, we create one afresh each time; also, those partdescs are stored in PortalContext inste= ad of CacheMemoryContext. find_inheritance_children gets a new output *detached_exist boolean, which indicates whether any partiti= on 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() argu= ments 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 outpu= t of that test was bogus. This commit also corrects that expected output. Au= thor: Amit Langote a= ;mitlangote09@= gmail.com Author: =C3=81lvaro= Herrera alv= herre@alvh.no= -ip.org Discussion: https://postgr.es/m/3269784.16= 17215412@sss.pgh.pa.us htt= ps://git.postgresql.org/pg/commitdiff/8aba9322511f718f12b618470d8c07f0ee5f0= 700

  • Fix uninitialized memory bug. Have interest= ed 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). h= ttps://git.postgresql.org/pg/commitdiff/43b55ec4bc3bc06596d966391f16defe016= 310ec

Etsuro Fujita pushed:

Fujii Masao pushed:

  • doc: Fix obsolete description about pg_base= backup. Previously it was documented that if using "-X none" option there was no guarantee that all required WAL files were archived at the end of pg_basebackup when taking a backup from the standby. But this limitation was removed by commit 52f8a5= 9dd9. Now, even when taking a backup from the standby, pg_basebackup can wait f= or all required WAL files to be archived. Therefore this commit removes such obsolete description from the docs. Also this commit adds new description about the limitation when taking a backup from the standby, into the docs= . The limitation is that pg_basebackup cannot force the standbfy to switch to a= new WAL file at the end of backup, which may cause pg_basebackup to wait a lo= ng time for the last required WAL file to be switched and archived, especial= ly when write activity on the primary is low. Back-patch to v10 where the i= ssue was introduced. Reported-by: Kyotaro Horiguchi Author: Kyotaro Horiguchi, Fujii Masao Reviewed-by: Kyotaro Horiguchi, Fujii Masao Discussion: htt= ps://postgr.es/m/20210420.133235.1342729068750553399.horikyota.ntt@gmail.co= m htt= ps://git.postgresql.org/pg/commitdiff/eaec48b3c54eec222d64468b57af80ee4ddf7= 6a9

  • Reorder COMPRESSION option in gram.y and pa= rsenodes.h into alphabetical order. Commit bbe0a81db6 introduced "INCLUDING COMPRESSION" option in CREATE TAB= LE command, but previously TableLikeOption in gram.y and parsenodes.h didn't classify this new option in alphabetical order with the rest. Author: Fu= jii Masao Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/YHerAixOhfR1ry= Xa@paquier.xyz htt= ps://git.postgresql.org/pg/commitdiff/3f20d5f37086e548c32ddb9d6ae09c2e1ce30= 0ce

Alexander Korotkov pushed:

Noah Misch pushed:

Pending Patches

Peter Smith sent in a patch to rearrange th= e option list for CREATE SUBSCRIPTION.

Bharath Rupireddy sent in another revision = of a patch to add new table AMs for multi- and single- inserts, and use same for CTAS, REFRESH MATERIALIZED VIE= W, and COPY.

Amul Sul sent in two more revisions of a pa= tch to remove a redundant variable from transformCreateStmt.

Pavel St=C4=9Bhule sent in another revision= of a patch to make it possible to log seqscans in auto_explain.

David Rowley sent in another revision of a = patch to reduce the number of contrib build special cases on Windows.

Amul Sul sent in two more revisions of a pa= tch to add a RelationGetSmgr inline function.

Masahiko Sawada sent in two more revisions = of a patch to skip vmbuffer for frozen tuple insertion.

Dagfinn Ilmari Manns=C3=A5ker sent in a pat= ch to create a function for stripping RelabelType nodes off an expression, consolidating many repetitions of the = same pattern into one.

Masahiko Sawada and Amit Kapila traded patc= hes to use HTAB for replication slot statistics.

Vigneshwaran C and Amit Kapila traded patch= es to update decoding stats during replication slot release.

Bharath Rupireddy sent in a patch to use Wa= itLatches for lock waiting in lazy_truncate_heap, in do_pg_stop_backup instead of a pg_usleep(), and for = pre- and post- auth delay.

Bharath Rupireddy sent in a patch to move t= he parallel_leader_participation GUC to the resource consumption category.

Peter Smith sent in two more revisions of a= patch to add support for prepared transactions to built-in logical replication, and add prepare API support f= or streaming transactions.

Dan Carter sent in a patch to add a GSSAPI = ccache_name option to libpq.

Takamichi Osumi and Amit Kapila traded patc= hes to fix an infelicity between TRUNCATE and synchronous logical replication.

Amit Langote sent in a patch to fix a tupde= sc leak in the pgoutput plugin.

Bharath Rupireddy sent in a patch to skip V= ACUUM/ANALYZE of repeated relations.

Pavel St=C4=9Bhule sent in another revision= of a patch to add a PSQL_WATCH_PAGER setting to psql.

Masahiro Ikeda sent in another revision of = a patch to make some performance improvements in reporting WAL stats without introducing a new variable.

Fujii Masao sent in four more revisions of = a patch to document the way TRUNCATE works on foreign tables, and ensure that any ONLY clauses in the original q= uery not be passed to same.

Hou Zhijie sent in a patch to fix a test ca= se with the wrong parallel safety flag.

Zeng Wenjing sent in another revision of a = patch to implement global temporary tables.

Simon Riggs sent in a patch to document the= fact that altering a constraint to VALIDATE it requires a SHARE UPDATE EXCLUSIVE lock.

Simon Riggs sent in a patch to reduce the l= ock level for CHECK constraints when allowing them to be NOT VALID.

Daniil Zakhlystov sent in another revision = of a patch to add zlib and zstd streaming compression, and implement libpq compression.

Tom Lane sent in a patch to document Julian= dates better.

=C3=81lvaro Herrera sent in a patch to add = tab-complete for ALTER TABLE .. DETACH PARTITION CONCURRENTLY to psql.

Tom Stellard sent in a patch to jit to work= around a potential data layout mismatch on s390x.

Justin Pryzby sent in a patch to add COMPRE= SSION as a possibility when executing CREATE TABLE ... LIKE.

Kyotaro HORIGUCHI sent in a patch to fix up= some dubious messages.

Tang sent in a patch to use pg_strncasecmp = to replace strncmp when comparing things "pg_" in psql.

Tang sent in another revision of a patch to= support tab completion for upper case character inputs in psql.

Hou Zhijie sent in another revision of a pa= tch to make it possible to execute INSERT SELECT in parallel.

Mark Dilger and Robert Haas traded patches = to add toast pointer corruption checks to pg_amcheck.

Bharath Rupireddy sent in a patch to MAXALI= GN sizeof(BTPageOpaqueData) in PageGetItemIdCareful.

Ajin Cherian sent in another revision of a = patch to skip empty transactions for logical replication.

Alexander Pyhalov sent in another revision = of a patch to push down restrictinfos to CTEs, and attempt to prune partitions in the process.

Thomas Munro sent in a patch to add a new T= AP test under src/test/recovery that runs the regression tests with wal_consistency_checking=3Dall.

Joel Jacobson sent in a patch to fix pg_ide= ntify_object_as_address for event triggers.

Takamichi Osumi sent in a patch to replace = the check of RelationIsLogicallyLogged in ReorderBufferProcessTXN with an Assert to the = same effect.

David Rowley sent in another revision of a = patch to speed up NOT IN() with a set of Consts by allowing hash tables to be used.

David Rowley and Yura Sokolov traded patche= s to use simplehash.h instead of dynahash in SMgr.

Julien Rouhaud sent in a patch to fix some = oversights in query_id calculation.

Tom Lane sent in a patch to make it require= d for callers of pq_getmessage to provide an upper length bound, and installs the same sort of short-vs-long message heuristic as libpq has in the server.

This email was sent to you from PWN. It was delivered on their behalf by the PostgreSQL project. Any questions about the content of the message shou= ld be sent to PWN.

You were sent this email as a subscriber of the pgsql-announce mai= linglist, for the content tag PWN. To unsubscribe from further emails, or change which emails you want to receive, please click th= e personal unsubscribe link that you can find in the headers of this email, or visit https://lists.postgresql.org/unsubscribe/.
 
--===============4183336256831844997==-- --===============1928479652468271500==--