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 1memmq-0006XV-89 for pgsql-announce@arkaria.postgresql.org; Sun, 24 Oct 2021 23:20:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1memmo-0007zY-SI for pgsql-announce@arkaria.postgresql.org; Sun, 24 Oct 2021 23:20:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1memmn-0007xJ-Uj for pgsql-announce@lists.postgresql.org; Sun, 24 Oct 2021 23:20:18 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1memmd-0002Ta-BB for pgsql-announce@lists.postgresql.org; Sun, 24 Oct 2021 23:20:17 +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=UjX2EeiS1b2yzHJ1r5xGIYjIX3QqGe/pDCWmjwBX8tQ=; b=Dq00Ic/wlwxvhfZ2Q1qn8Ys39J hrXZo4wO8aPiVcL8XkKkhkBLXjDWP5jHb5zHmYyndwy5cbeXcVXqoQKqJSg6brEQ+y9/6K43CbqPk 8YBj6C+gPSTMoHQmQ/ETZF6dJtXSAgL35IIyGovAFvHTO+eEmfd5s/PIzfjWbebahewFbfYxi6T5+ NGSb6FAA6+ppbwOwOuYVGwl7X7gygGrI9/I4/nCAmLA7mF0zjdDy1BdkHruzcGK9qIQYzN5zpaGXP BniinMewLYpwkmYqJv8n+ZT+vUqINFI1Hso74xp3zs8WAZ2yO+mXkey6mwycPh8TPkN2W1m3S1iOf pCyjnoGQ==; 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 1memma-0006r7-Qw for pgsql-announce@lists.postgresql.org; Sun, 24 Oct 2021 23:20:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1memmY-0002Df-4l for pgsql-announce@lists.postgresql.org; Sun, 24 Oct 2021 23:20:02 +0000 Content-Type: multipart/mixed; boundary="===============2937662810589799231==" MIME-Version: 1.0 Subject: PostgreSQL Weekly News - October 24, 2021 To: PostgreSQL Announce From: PWN via PostgreSQL Announce Reply-To: david@fetter.org Date: Sun, 24 Oct 2021 23:19:49 +0000 Message-ID: <163511758924.675.9206788689251844482@wrigleys.postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-pglister-tags: pwn X-pglister-tagsig: 8236f293a6cee783bc87e499b2cfef03c715a17a892982d5f9adf817e5e5c837 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --===============2937662810589799231== Content-Type: multipart/alternative; boundary="===============7047657102201655424==" MIME-Version: 1.0 --===============7047657102201655424== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable # PostgreSQL Weekly News - October 24, 2021 # PostgreSQL Product News JDBC 42.3.0 [released](https://jdbc.postgresql.org/documentation/changelog.html#version= _42.3.0). pgmetrics 1.12, a command-line tool for PostgreSQL metrics, [released](https://pgmetrics.io/). StackGres 1.0.0, a platform for running PostgreSQL on Kubernetes, released. https://stackgres.io/ pgexporter 0.2.0, a Prometheus exporter for PostgreSQL, [released](https://pgexporter.github.io///release/announcement/2021/10/20/p= gexporter-0.2.0.html) pgAdmin4 6.1, a web- and native GUI control center for PostgreSQL, [released](https://www.pgadmin.org/docs/pgadmin4/6.1/release_notes_6_1.html= ). # PostgreSQL Jobs for October [https://archives.postgresql.org/pgsql-jobs/2021-10/](https://archives.post= gresql.org/pgsql-jobs/2021-10/) # 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 Micha=C3=ABl Paquier pushed: - Fix portability issues in new TAP tests of psql. The tests added by c0280= bc and d9ddc50 in 001_basic.pl have introduced commands calling directly psq= l, making them sensitive to the environment. One issue was that those comma= nds forgot -X to not use a local .psqlrc, causing all those tests to fail if = psql cannot properly parse this file. TAP tests should be designed so as they= run in an isolated fashion, without any dependency on the environment where t= hey are run. As PostgresNode::psql gives already all the facilities those new tests need, switch to that instead of calling plain psql commands where interactions with a backend are needed. The test is slightly refactored = to be able to check after the expected patterns of stdout and stderr, keeping t= he same amount of coverage as previously. Reported-by: Peter Geoghegan Discussion: [https://postgr.es/m/CAH2-Wzn8ftvcDPwomn+y04JJzbT=3DTG7TN=3DQsmSEATUOW-Zu= vQQ@mail.gmail.com](https://postgr.es/m/CAH2-Wzn8ftvcDPwomn+y04JJzbT=3DTG7T= N=3DQsmSEATUOW-ZuvQQ@mail.gmail.com) [https://git.postgresql.org/pg/commitdiff/384f1abdb9b0f669279fcd57ba2173e= b31724740](https://git.postgresql.org/pg/commitdiff/384f1abdb9b0f669279fcd5= 7ba2173eb31724740) - Reset properly snapshot export state during transaction abort. During a replication slot creation, an ERROR generated in the same transaction as = the one creating a to-be-exported snapshot would have left the backend in an inconsistent state, as the associated static export snapshot state was not being reset on transaction abort, but only on the follow-up command recei= ved by the WAL sender that created this snapshot on replication slot creation. This would trigger inconsistency failures if this session tried to export again a snapshot, like during the creation of a replication slot. Note t= hat a snapshot export cannot happen in a transaction block, so there is no need= to worry resetting this state for subtransaction aborts. Also, this inconsi= stent state would very unlikely show up to users. For example, one case where = this could happen is an out-of-memory error when building the initial snapshot to-be-exported. Dilip found this problem while poking at a different patc= h, that caused an error in this code path for reasons unrelated to HEAD. Au= thor: Dilip Kumar Reviewed-by: Michael Paquier, Zhihong Yu Discussion: [https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc_g81WrpcETB5=3D= w@mail.gmail.com](https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc= _g81WrpcETB5=3Dw@mail.gmail.com) Backpatch-through: 9.6 [https://git.postgresql.org/pg/commitdiff/409f9ca4471331be0f77b665ff3a183= 6a41de5b3](https://git.postgresql.org/pg/commitdiff/409f9ca4471331be0f77b66= 5ff3a1836a41de5b3) - Block ALTER INDEX/TABLE index_name ALTER COLUMN colname SET (options). The grammar of this command run on indexes with column names has always been authorized by the parser, and it has never been documented. Since 911e70= 2, it is possible to define opclass parameters as of CREATE INDEX, which actual= ly broke the old case of ALTER INDEX/TABLE where relation-level parameters n_distinct and n_distinct_inherited could be defined for an index (see 76= a47c0 and its thread where this point has been touched, still remained unused). Attempting to do that in v13~ would cause the index to become unusable, as there is a new dedicated code path to load opclass parameters instead of = the relation-level ones previously available. Note that it is possible to fix things with a manual catalog update to bring the relation back online. T= his commit disables this command for now as the use of column names for index= es does not make sense anyway, particularly when it comes to index expressio= ns where names are automatically computed. One way to properly support this= case properly in the future would be to use column numbers when it comes to indexes, in the same way as ALTER INDEX .. ALTER COLUMN .. SET STATISTICS. Partitioned indexes were already blocked, but not indexes. Some tests are added for both cases. There was some code in ANALYZE to enforce n_distin= ct to be used for an index expression if the parameter was defined, but just re= move it for now until/if there is support for this (note that index-level parameters never had support in pg_dump either, previously), so this was = just dead code. Reported-by: Matthijs van der Vleuten Author: Nathan Bossart, Michael Paquier Reviewed-by: Vik Fearing, Dilip Kumar Discussion: [https://postgr.es/m/17220-15d684c6c2171a83@postgresql.org](https://postg= r.es/m/17220-15d684c6c2171a83@postgresql.org) Backpatch-through: 13 [https://git.postgresql.org/pg/commitdiff/fdd88571454e2b00dbe446e8609c6e4= 294ca89ae](https://git.postgresql.org/pg/commitdiff/fdd88571454e2b00dbe446e= 8609c6e4294ca89ae) - Fix build of MSVC with OpenSSL 3.0.0. The build scripts of Visual Studio = would fail to detect properly a 3.0.0 build as the check on the second digit was failing. This is adjusted where needed, allowing the builds to complete. Note that the MSIs of OpenSSL mentioned in the documentation have not cha= nged any library names for Win32 and Win64, making this change straight-forwar= d. Reported-by: htalaco, via github Reviewed-by: Daniel Gustafsson Discussio= n: [https://postgr.es/m/YW5XKYkq6k7OtrFq@paquier.xyz](https://postgr.es/m/YW= 5XKYkq6k7OtrFq@paquier.xyz) Backpatch-through: 9.6 [https://git.postgresql.org/pg/commitdiff/41f30ecc29c89285d3eecd435906c4e= 9cb048be4](https://git.postgresql.org/pg/commitdiff/41f30ecc29c89285d3eecd4= 35906c4e9cb048be4) - Fix corruption of pg_shdepend when copying deps from template database. U= sing for a new database a template database with shared dependencies that need= to be copied over was causing a corruption of pg_shdepend because of an off-by-one computation error of the index number used for the values inse= rted with a slot. Issue introduced by e3931d0. Monitoring the rest of the co= de, there are no similar mistakes. Reported-by: Sven Klemm Author: Aleksander Alekseev Reviewed-by: Daniel Gustafsson, Michael Paquier Discussion: [https://postgr.es/m/CAJ7c6TP0AowkUgNL6zcAK-s5HYsVHVBRWfu69FRubPpfwZGM9A@= mail.gmail.com](https://postgr.es/m/CAJ7c6TP0AowkUgNL6zcAK-s5HYsVHVBRWfu69F= RubPpfwZGM9A@mail.gmail.com) Backpatch-through: 14 [https://git.postgresql.org/pg/commitdiff/98ec35b0bbf6003e89fc06aa140e12f= d90bbad47](https://git.postgresql.org/pg/commitdiff/98ec35b0bbf6003e89fc06a= a140e12fd90bbad47) - doc: Describe calculation method of streaming start for pg_receivewal. The documentation was imprecise about the starting LSN used for WAL streaming= if nothing can be found in the local archive directory defined with the pg_receivewal command, so be more talkative on this matter. Extracted fr= om a larger patch by the same author. Author: Ronan Dunklau, Michael Paquier Discussion: [https://postgr.es/m/18708360.4lzOvYHigE@aivenronan](https://postgr.es/m/= 18708360.4lzOvYHigE@aivenronan) Backpatch-through: 10 [https://git.postgresql.org/pg/commitdiff/1e9475694b0ae2cf1204d01d2ef6ad8= 6f3c7cac8](https://git.postgresql.org/pg/commitdiff/1e9475694b0ae2cf1204d01= d2ef6ad86f3c7cac8) Heikki Linnakangas pushed: - Replace polyphase merge algorithm with a simple balanced k-way merge. The advantage of polyphase merge is that it can reuse the input tapes as outp= ut tapes efficiently, but that is irrelevant on modern hardware, when we can easily emulate any number of tape drives. The number of input tapes we can/should use during merging is limited by work_mem, but output tapes th= at we are not currently writing to only cost a little bit of memory, so there i= s no need to skimp on them. This makes sorts that need multiple merge passes faster. Discussion: [https://www.postgresql.org/message-id/420a0ec7-602c-d406-1e75-1ef7ddc58d= 83%40iki.fi](https://www.postgresql.org/message-id/420a0ec7-602c-d406-1e75-= 1ef7ddc58d83%40iki.fi) Reviewed-by: Peter Geoghegan, Zhihong Yu, John Naylor [https://git.postgresql.org/pg/commitdiff/65014000b351d5725eb00d133416ab1= b4f8245b1](https://git.postgresql.org/pg/commitdiff/65014000b351d5725eb00d1= 33416ab1b4f8245b1) - Refactor LogicalTapeSet/LogicalTape interface. All the tape functions, li= ke LogicalTapeRead and LogicalTapeWrite, now take a LogicalTape as argument, instead of LogicalTapeSet+tape number. You can create any number of LogicalTapes in a single LogicalTapeSet, and you don't need to decide the number upfront, when you create the tape set. This makes the tape manage= ment in hash agg spilling in nodeAgg.c simpler. Discussion: [https://www.postgresql.org/message-id/420a0ec7-602c-d406-1e75-1ef7ddc58d= 83%40iki.fi](https://www.postgresql.org/message-id/420a0ec7-602c-d406-1e75-= 1ef7ddc58d83%40iki.fi) Reviewed-by: Peter Geoghegan, Zhihong Yu, John Naylor [https://git.postgresql.org/pg/commitdiff/c4649cce39a41b27db874e75ddd47ad= aec1b0ea4](https://git.postgresql.org/pg/commitdiff/c4649cce39a41b27db874e7= 5ddd47adaec1b0ea4) - Fix format modifier used in elog. The previous commit 65014000b3 changed = the variable passed to elog from an int64 to a size_t variable, but neglected= to change the modifier in the format string accordingly. Per failure on buildfarm member lapwing. [https://git.postgresql.org/pg/commitdiff/0bd65a3905706927cdd6b3158b6457c= 1c854471b](https://git.postgresql.org/pg/commitdiff/0bd65a3905706927cdd6b31= 58b6457c1c854471b) - Fix duplicate typedef LogicalTape. To make buildfarm member locust happy. [https://git.postgresql.org/pg/commitdiff/aa3ac6453b28049b3198433b7522827= 1b7612d4a](https://git.postgresql.org/pg/commitdiff/aa3ac6453b28049b3198433= b75228271b7612d4a) - Fix parallel sort, broken by the balanced merge patch. The code for initializing the tapes on each merge iteration was skipped in a parallel worker. I put the !WORKER(state) check in wrong place while rebasing the patch. That caused failures in the index build in 'multiple-row-versions' isolation test, in multiple buildfarm members. On my laptop it was easier= to reproduce by building an index on a larger table, so that you got a paral= lel sort more reliably. [https://git.postgresql.org/pg/commitdiff/fc0f3b4cb0e882a9c5d51c302d4aa35= 91e4f80fd](https://git.postgresql.org/pg/commitdiff/fc0f3b4cb0e882a9c5d51c3= 02d4aa3591e4f80fd) =C3=81lvaro Herrera pushed: - Invalidate partitions of table being attached/detached. Failing to do tha= t, any direct inserts/updates of those partitions would fail to enforce the correct constraint, that is, one that considers the new partition constra= int of their parent table. Backpatch to 10. Reported by: Hou Zhijie Author: Amit Langote Author: =C3=81lvaro Herrera Reviewed-by: Nitin = Jadhav Reviewed-by: Pavel Borisov Discussion: [https://postgr.es/m/OS3PR01MB5718DA1C4609A25186D1FBF194089%40OS3PR01MB57= 18.jpnprd01.prod.outlook.com](https://postgr.es/m/OS3PR01MB5718DA1C4609A251= 86D1FBF194089%40OS3PR01MB5718.jpnprd01.prod.outlook.com) [https://git.postgresql.org/pg/commitdiff/d6f1e16c8fe27100e371a15aeeb498f= aa680ceed](https://git.postgresql.org/pg/commitdiff/d6f1e16c8fe27100e371a15= aeeb498faa680ceed) - Ensure correct lock level is used in ALTER ... RENAME. Commit 1b5d797cd4f7 intended to relax the lock level used to rename indexes, but inadvertently allowed *any* relation to be renamed with a lowered lock level, as long a= s the command is spelled ALTER INDEX. That's undesirable for other relation typ= es, so retry the operation with the higher lock if the relation turns out not= to be an index. After this fix, ALTER INDEX RENAME will require access exclusive lock, which it didn't before. Author: Nathan Bossart Author: =C3=81lvaro Herrera Reported-by: Onder Kalaci Discussion: [https://postgr.es/m/PH0PR21MB1328189E2821CDEC646F8178D8AE9@PH0PR21MB1328= .namprd21.prod.outlook.com](https://postgr.es/m/PH0PR21MB1328189E2821CDEC64= 6F8178D8AE9@PH0PR21MB1328.namprd21.prod.outlook.com) [https://git.postgresql.org/pg/commitdiff/c2c618ff1137f9ef58827f57e4ec0f9= 7453e454e](https://git.postgresql.org/pg/commitdiff/c2c618ff1137f9ef58827f5= 7e4ec0f97453e454e) - Protect against collation variations in test. Discussion: [https://postgr.es/m/YW/MYdSRQZtPFBWR@paquier.xyz](https://postgr.es/m/YW= /MYdSRQZtPFBWR@paquier.xyz) [https://git.postgresql.org/pg/commitdiff/cd124d205c42a623b68cd155ace94cc= 376851b78](https://git.postgresql.org/pg/commitdiff/cd124d205c42a623b68cd15= 5ace94cc376851b78) Daniel Gustafsson pushed: - Fix sscanf limits in pg_basebackup and pg_dump. Make sure that the string parsing is limited by the size of the destination buffer. In pg_baseback= up the available values sent from the server is limited to two characters so there was no risk of overflow. In pg_dump the buffer is bounded by MAXPG= PATH, and thus the limit must be inserted via preprocessor expansion and the bu= ffer increased by one to account for the terminator. There is no risk of overf= low here, since in this case, the buffer scanned is smaller than the destinat= ion buffer. Backpatch the pg_basebackup fix to 11 where it was introduced, a= nd the pg_dump fix all the way down to 9.6. Reviewed-by: Tom Lane Discussio= n: [https://postgr.es/m/B14D3D7B-F98C-4E20-9459-C122C67647FB@yesql.se](https= ://postgr.es/m/B14D3D7B-F98C-4E20-9459-C122C67647FB@yesql.se) Backpatch-through: 11 and 9.6 [https://git.postgresql.org/pg/commitdiff/1d7641d51a51aa00dff685022fab6c0= 3be8f8af8](https://git.postgresql.org/pg/commitdiff/1d7641d51a51aa00dff6850= 22fab6c03be8f8af8) - Fix bug in TOC file error message printing. If the blob TOC file cannot be parsed, the error message was failing to print the filename as the variab= le holding it was shadowed by the destination buffer for parsing. When the filename fails to parse, the error will print an empty string: ./pg_res= tore -d foo -F d dump pg_restore: error: invalid line in large object TOC fil= e "": .. ..instead of the intended error message: ./pg_restore -d foo -F d d= ump pg_restore: error: invalid line in large object TOC file "dump/blobs.toc"= : .. Fix by renaming both variables as the shared name was too generic to store either and still convey what the variable held. Backpatch all the way do= wn to 9.6. Reviewed-by: Tom Lane Discussion: [https://postgr.es/m/A2B151F5-B32B-4F2C-BA4A-6870856D9BDE@yesql.se](https= ://postgr.es/m/A2B151F5-B32B-4F2C-BA4A-6870856D9BDE@yesql.se) Backpatch-through: 9.6 [https://git.postgresql.org/pg/commitdiff/998d060f3db79c6918cb4a547695be1= 50833f9a4](https://git.postgresql.org/pg/commitdiff/998d060f3db79c6918cb4a5= 47695be150833f9a4) - Refactor the sslfiles Makefile target for ease of use. The Makefile handl= ing of certificate and keypairs used for TLS testing had become quite difficu= lt to work with. Adding a new cert without the need to regenerate everything wa= s too complicated. This patch refactors the sslfiles make target such that addi= ng a new certificate requires only adding a .config file, adding it to the top= of the Makefile, and running make sslfiles. Improvements: - Interfile dependencies should be fixed, with the exception of the CRL dirs. - New certificates have serial numbers based on the current time, reducing the chance of collision. - The CA index state is created on demand and cleane= d up automatically at the end of the Make run. - `*.config` files are now self-contained; one certificate needs one config file instead of two. - Duplication is reduced, and along with it some unneeded code (and possi= ble copy-paste errors). - all configuration files underneath the conf/ direct= ory. The target is moved to its own makefile in order to avoid colliding with global make settings. Author: Jacob Champion Reviewed-by: Michael Paquier Discussion: [https://postgr.es/m/d15a9838344ba090e09fd866abf913584ea19fb7.camel@vmwar= e.com](https://postgr.es/m/d15a9838344ba090e09fd866abf913584ea19fb7.camel@v= mware.com) [https://git.postgresql.org/pg/commitdiff/b4c4a00eada3c512e819e9163114a5a= d1606bc7e](https://git.postgresql.org/pg/commitdiff/b4c4a00eada3c512e819e91= 63114a5ad1606bc7e) - Fix SSL tests on 32-bit Perl. The certificate serial number generation was changed in b4c4a00ea to use the current timestamp. The testharness must t= hus interrogate the cert for the serialnumber using "openssl x509" which emit= s the serial in hex format. Converting the serial to integer format to match wh= ats in pg_stat_ssl requires a 64-bit capable Perl. This adds a fallback to checking for an integer when the tests with a 32-bit Perl. Per failure on buildfarm member prairiedog. Discussion: [https://postgr.es/m/0D295F43-806D-4B3F-AB98-F941A19E0271@yesql.se](https= ://postgr.es/m/0D295F43-806D-4B3F-AB98-F941A19E0271@yesql.se) [https://git.postgresql.org/pg/commitdiff/0c04342b1d3dd5b24f795f94874163b= e8e21710e](https://git.postgresql.org/pg/commitdiff/0c04342b1d3dd5b24f795f9= 4874163be8e21710e) Tom Lane pushed: - Remove bogus assertion in transformExpressionList(). I think when I added= this assertion (in commit 8f889b108), I was only thinking of the use of transformExpressionList at top level of INSERT and VALUES. But it's also called by transformRowExpr(), which can certainly occur in an UPDATE targetlist, so it's inappropriate to suppose that p_multiassign_exprs mus= t be empty. Besides, since the input is not expected to contain ResTargets, there's no reason it should contain MultiAssignRefs either. Hence this c= ode need not be concerned about the state of p_multiassign_exprs, and we shou= ld just drop the assertion. Per bug #17236 from ocean_li_996. It's been wr= ong for years, so back-patch to all supported branches. Discussion: [https://postgr.es/m/17236-3210de9bcba1d7ca@postgresql.org](https://postg= r.es/m/17236-3210de9bcba1d7ca@postgresql.org) [https://git.postgresql.org/pg/commitdiff/697dd1925f418c9f54ee1fd1cefbc61= 3d6504b1f](https://git.postgresql.org/pg/commitdiff/697dd1925f418c9f54ee1fd= 1cefbc613d6504b1f) - Fix assignment to array of domain over composite. An update such as "UPDA= TE ... SET fld[n].subfld =3D whatever" failed if the array elements were dom= ains rather than plain composites. That's because isAssignmentIndirectionExpr= () failed to cope with the CoerceToDomain node that would appear in the expression tree in this case. The result would typically be a crash, and= even if we accidentally didn't crash, we'd not correctly preserve other fields= of the same array element. Per report from Onder Kalaci. Back-patch to v11 where arrays of domains came in. Discussion: [https://postgr.es/m/PH0PR21MB132823A46AA36F0685B7A29AD8BD9@PH0PR21MB1328= .namprd21.prod.outlook.com](https://postgr.es/m/PH0PR21MB132823A46AA36F0685= B7A29AD8BD9@PH0PR21MB1328.namprd21.prod.outlook.com) [https://git.postgresql.org/pg/commitdiff/3e310d837a9b3de8ad977c0a3e2a769= bcdf61cc9](https://git.postgresql.org/pg/commitdiff/3e310d837a9b3de8ad977c0= a3e2a769bcdf61cc9) - pg_dump: Reorganize getTables(). Along the same lines as 047329624, ed2c7= f65b and daa9fe8a5, reduce code duplication by having just one copy of the par= ts of the query that are the same across all server versions; and make the conditionals control the smallest possible amount of code. This also gets= rid of the confusing assortment of different ways to accomplish the same resu= lt that we had here before. While at it, make sure all three relevant parts= of the function list the fields in the same order. This is just neatnik-ism= , of course. Discussion: [https://postgr.es/m/1240992.1634419055@sss.pgh.pa.us](https://postgr.es/= m/1240992.1634419055@sss.pgh.pa.us) [https://git.postgresql.org/pg/commitdiff/4438eb4a495c977d8ac485dd6e544c2= b6e077deb](https://git.postgresql.org/pg/commitdiff/4438eb4a495c977d8ac485d= d6e544c2b6e077deb) - Improve pg_regress.c's infrastructure for issuing psql commands. Support issuing more than one "-c command" switch to a single psql invocation. T= his allows combining some things that formerly required two or more backend launches into a single session. In particular, we can issue DROP DATABASE= as one of the -c commands without getting "DROP DATABASE cannot run inside a transaction block". In addition to reducing the number of sessions neede= d, this patch also suppresses "NOTICE: database "foo" does not exist, skipp= ing" chatter that was formerly generated during pg_regress's DROP DATABASE (or ROLE) IF NOT EXISTS calls. That moves us another step closer to the idea= l of not seeing any messages during successful build/test. This also eliminat= es some hard-coded restrictions on the length of the commands issued. I don= 't think we were anywhere near hitting those, but getting rid of the limit is comforting. Patch by me, but thanks to Nathan Bossart for starting the discussion. Discussion: [https://postgr.es/m/DCBAE0E4-BD56-482F-8A70-7FD0DC0860BE@amazon.com](htt= ps://postgr.es/m/DCBAE0E4-BD56-482F-8A70-7FD0DC0860BE@amazon.com) [https://git.postgresql.org/pg/commitdiff/f45dc59a38cab1d2af6baaedb79559f= e2e9b3781](https://git.postgresql.org/pg/commitdiff/f45dc59a38cab1d2af6baae= db79559fe2e9b3781) - Doc: clarify a critical and undocumented aspect of simplehash.h. I just g= ot burnt by trying to use pg_malloc instead of pg_malloc0 with this. Save t= he next hacker some time by not leaving this API detail undocumented. [https://git.postgresql.org/pg/commitdiff/b1ce6c284366ce1dae120f5d10dd59e= 8804322ee](https://git.postgresql.org/pg/commitdiff/b1ce6c284366ce1dae120f5= d10dd59e8804322ee) - pg_dump: fix mis-dumping of non-global default privileges. Non-global def= ault privilege entries should be dumped as-is, not made relative to the defaul= t ACL for their object type. This would typically only matter if one had revoked some on-by-default privileges in a global entry, and then wanted to grant= them again in a non-global entry. Per report from Boris Korzun. This is an o= ld bug, so back-patch to all supported branches. Neil Chen, test case by Masahiko Sawada Discussion: [https://postgr.es/m/111621616618184@mail.yandex.ru](https://postgr.es/m/= 111621616618184@mail.yandex.ru) Discussion: [https://postgr.es/m/CAA3qoJnr2+1dVJObNtfec=3DqW4Z0nz=3DA9+r5bZKoTSy5RDjs= kMw@mail.gmail.com](https://postgr.es/m/CAA3qoJnr2+1dVJObNtfec=3DqW4Z0nz=3D= A9+r5bZKoTSy5RDjskMw@mail.gmail.com) [https://git.postgresql.org/pg/commitdiff/2acc84c6fd299125702c8a8af13820a= bcc0d4891](https://git.postgresql.org/pg/commitdiff/2acc84c6fd299125702c8a8= af13820abcc0d4891) - Fix frontend version of sh_error() in simplehash.h. The code does not exp= ect sh_error() to return, but the patch that made this header usable in front= end didn't get that memo. While here, plaster unlikely() on the tests that d= ecide whether to invoke sh_error(), and add our standard copyright notice. Not= ed by Andres Freund. Back-patch to v13 where this frontend support came in. Discussion: [https://postgr.es/m/0D54435C-1199-4361-9D74-2FBDCF8EA164@anarazel.de](ht= tps://postgr.es/m/0D54435C-1199-4361-9D74-2FBDCF8EA164@anarazel.de) [https://git.postgresql.org/pg/commitdiff/974aedcea46dfd0119eea2fbb2eeacd= 232596f05](https://git.postgresql.org/pg/commitdiff/974aedcea46dfd0119eea2f= bb2eeacd232596f05) - In pg_dump, use simplehash.h to look up dumpable objects by OID. Create a= hash table that indexes dumpable objects by CatalogId (that is, catalog OID + object OID). Use this to replace the former catalogIdMap array, as well = as various other single- catalog index arrays, and also the extension member= ship map. In principle this should be faster for databases with many objects, since lookups are now O(1) not O(log N). However, it seems that these lo= okups are pretty much negligible in context, so that no overall performance cha= nge can be measured. But having only one lookup data structure to maintain m= akes the code simpler and more flexible, so let's do it anyway. Discussion: [https://postgr.es/m/2595220.1634855245@sss.pgh.pa.us](https://postgr.es/= m/2595220.1634855245@sss.pgh.pa.us) [https://git.postgresql.org/pg/commitdiff/92316a4582a5714d4e494aaf9036086= 0e7fec37a](https://git.postgresql.org/pg/commitdiff/92316a4582a5714d4e494aa= f90360860e7fec37a) - Fix minor memory leaks in pg_dump. I found these by running pg_dump under "valgrind --leak-check=3Dfull". The changes in flagInhIndexes() and getIndexes() replace allocation of an array of which we use only some ele= ments by individual allocations of just the actually-needed objects. The previ= ous coding wasted some memory, but more importantly it confused valgrind's le= ak tracking. collectComments() and collectSecLabels() remain major blots on= the valgrind report, because they don't PQclear their query results, in order= to avoid a lot of strdup's. That's a dubious tradeoff, but I'll leave it al= one here; an upcoming patch will modify those functions enough to justify cha= nging the tradeoff. [https://git.postgresql.org/pg/commitdiff/70bef494000e4dbbeca0f0a40347ca1= 747aea701](https://git.postgresql.org/pg/commitdiff/70bef494000e4dbbeca0f0a= 40347ca1747aea701) Andres Freund pushed: - Adapt src/test/ldap/t/001_auth.pl to work with openldap 2.5. ldapsearch's deprecated -h/-p arguments were removed, need to use -H now - which has b= een around for over 20 years. As perltidy insists on reflowing the parameters anyway, change order and "phrasing" to yield a less confusing layout (per suggestion from Tom Lane). Discussion: [https://postgr.es/m/20211009233850.wvr6apcrw2ai6cnj@alap3.anarazel.de](h= ttps://postgr.es/m/20211009233850.wvr6apcrw2ai6cnj@alap3.anarazel.de) Backpatch: 11-, where the tests were added. [https://git.postgresql.org/pg/commitdiff/984f460e2f29e7ba9174cabb9f43a0d= 1dce543bf](https://git.postgresql.org/pg/commitdiff/984f460e2f29e7ba9174cab= b9f43a0d1dce543bf) Amit Kapila pushed: - Remove unused wait events. Commit 464824323e introduced the wait events w= hich were neither used by that commit nor by follow-up commits for that work. Author: Masahiro Ikeda Backpatch-through: 14, where it was introduced Discussion: [https://postgr.es/m/ff077840-3ab2-04dd-bbe4-4f5dfd2ad481@oss.nttdata.com= ](https://postgr.es/m/ff077840-3ab2-04dd-bbe4-4f5dfd2ad481@oss.nttdata.com) [https://git.postgresql.org/pg/commitdiff/1607cd0b6c9919bf765198882ea48a9= 8e901e1bc](https://git.postgresql.org/pg/commitdiff/1607cd0b6c9919bf7651988= 82ea48a98e901e1bc) Andrew Dunstan pushed: - Add module build directory to the PATH for TAP tests. For non-MSVC builds= this is make's $(CURDIR), while for MSVC builds it is $topdir/$Config/$module.= The directory is added as the second element in the PATH, so that the install location takes precedence, but the added PATH element takes precedence ov= er the rest of the PATH. The reason for this is to allow tests to find built products that are not installed, such as the libpq_pipeline test driver. = The libpq_pipeline test is adjusted to take advantage of this. Based on a suggestion from Andres Freund. Backpatch to release 14. Discussion: [https://postgr.es/m/4941f5a5-2d50-1a0e-6701-14c5fefe92d6@dunslane.net](h= ttps://postgr.es/m/4941f5a5-2d50-1a0e-6701-14c5fefe92d6@dunslane.net) [https://git.postgresql.org/pg/commitdiff/f4ce6c4d3a30ec3a12c7f64b90a6fc8= 2887ddd7b](https://git.postgresql.org/pg/commitdiff/f4ce6c4d3a30ec3a12c7f64= b90a6fc82887ddd7b) - Move Perl test modules to a better namespace. The five modules in our TAP= test framework all had names in the top level namespace. This is unwise becaus= e, even though we're not exporting them to CPAN, the names can leak, for exa= mple if they are exported by the RPM build process. We therefore move the modu= les to the PostgreSQL::Test namespace. In the process PostgresNode is renamed= to Cluster, and TestLib is renamed to Utils. PostgresVersion becomes simply PostgreSQL::Version, to avoid possible confusion about what it's the vers= ion of. Discussion: [https://postgr.es/m/aede93a4-7d92-ef26-398f-5094944c2504@dunslane.net](h= ttps://postgr.es/m/aede93a4-7d92-ef26-398f-5094944c2504@dunslane.net) Reviewed by Erik Rijkers and Michael Paquier [https://git.postgresql.org/pg/commitdiff/b3b4d8e68ae83f432f43f035c7eb481= ef93e1583](https://git.postgresql.org/pg/commitdiff/b3b4d8e68ae83f432f43f03= 5c7eb481ef93e1583) Noah Misch pushed: - Avoid race in RelationBuildDesc() affecting CREATE INDEX CONCURRENTLY. CI= C and REINDEX CONCURRENTLY assume backends see their catalog changes no later t= han each backend's next transaction start. That failed to hold when a backend absorbed a relevant invalidation in the middle of running RelationBuildDe= sc() on the CIC index. Queries that use the resulting index can silently fail= to find rows. Fix this for future index builds by making RelationBuildDesc() loop until it finishes without accepting a relevant invalidation. It may= be necessary to reindex to recover from past occurrences; REINDEX CONCURRENT= LY suffices. Back-patch to 9.6 (all supported versions). Noah Misch and And= rey Borodin, reviewed (in earlier versions) by Andres Freund. Discussion: [https://postgr.es/m/20210730022548.GA1940096@gust.leadboat.com](https://= postgr.es/m/20210730022548.GA1940096@gust.leadboat.com) [https://git.postgresql.org/pg/commitdiff/fdd965d074d46765c295223b119ca43= 7dbcac973](https://git.postgresql.org/pg/commitdiff/fdd965d074d46765c295223= b119ca437dbcac973) - Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions. The purpose of commit 8a54e12a38d1545d249f1402f66c8cde2837d97c was to fix thi= s, and it sufficed when the PREPARE TRANSACTION completed before the CIC loo= ked for lock conflicts. Otherwise, things still broke. As before, in a clus= ter having used CIC while having enabled prepared transactions, queries that = use the resulting index can silently fail to find rows. It may be necessary = to reindex to recover from past occurrences; REINDEX CONCURRENTLY suffices. = Fix this for future index builds by making CIC wait for arbitrarily-recent prepared transactions and for ordinary transactions that may yet PREPARE TRANSACTION. As part of that, have PREPARE TRANSACTION transfer locks to= its dummy PGPROC before it calls ProcArrayClearTransaction(). Back-patch to = 9.6 (all supported versions). Andrey Borodin, reviewed (in earlier versions)= by Andres Freund. Discussion: [https://postgr.es/m/01824242-AA92-4FE9-9BA7-AEBAFFEA3D0C@yandex-team.ru]= (https://postgr.es/m/01824242-AA92-4FE9-9BA7-AEBAFFEA3D0C@yandex-team.ru) [https://git.postgresql.org/pg/commitdiff/3cd9c3b921977272e6650a5efbeade4= 203c4bca2](https://git.postgresql.org/pg/commitdiff/3cd9c3b921977272e6650a5= efbeade4203c4bca2) --===============7047657102201655424== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable PostgreSQL Weekly News - October 24, 2021
 

PostgreSQL Weekly News - October 24, 2021

PostgreSQL Weekly News - October 24, 2021

PostgreSQL Product News

JDBC 42.3.0 released.=

pgmetrics 1.12, a command-line tool for Pos= tgreSQL metrics, released.

StackGres 1.0.0, a platform for running Pos= tgreSQL on Kubernetes, released. https://stackgres.io/

pgexporter 0.2.0, a Prometheus exporter for= PostgreSQL, = released

pgAdmin4 6.1, a web- and native GUI control= center for PostgreSQL, released.

PostgreSQL Jobs for October

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

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

Micha=C3=ABl Paquier pushed:

  • Fix portability issues in new TAP tests of = psql. The tests added by c0280bc and d9ddc50 in 001_basic.pl have introduced commands calling directly psq= l, making them sensitive to the environment. One issue was that those comma= nds forgot -X to not use a local .psqlrc, causing all those tests to fail if = psql cannot properly parse this file. TAP tests should be designed so as they= run in an isolated fashion, without any dependency on the environment where t= hey are run. As PostgresNode::psql gives already all the facilities those new tests need, switch to that instead of calling plain psql commands where interactions with a backend are needed. The test is slightly refactored = to be able to check after the expected patterns of stdout and stderr, keeping t= he same amount of coverage as previously. Reported-by: Peter Geoghegan Discussion: https://postgr.es/m/CAH2-Wzn8ftvcDPwomn+y04JJzbT=3DTG7TN=3DQsmSEATU= OW-ZuvQQ@mail.gmail.com htt= ps://git.postgresql.org/pg/commitdiff/384f1abdb9b0f669279fcd57ba2173eb31724= 740

  • Reset properly snapshot export state during= transaction abort. During a replication slot creation, an ERROR generated in the same transaction as = the one creating a to-be-exported snapshot would have left the backend in an inconsistent state, as the associated static export snapshot state was not being reset on transaction abort, but only on the follow-up command recei= ved by the WAL sender that created this snapshot on replication slot creation. This would trigger inconsistency failures if this session tried to export again a snapshot, like during the creation of a replication slot. Note t= hat a snapshot export cannot happen in a transaction block, so there is no need= to worry resetting this state for subtransaction aborts. Also, this inconsi= stent state would very unlikely show up to users. For example, one case where = this could happen is an out-of-memory error when building the initial snapshot to-be-exported. Dilip found this problem while poking at a different patc= h, that caused an error in this code path for reasons unrelated to HEAD. Au= thor: Dilip Kumar Reviewed-by: Michael Paquier, Zhihong Yu Discussion: https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc_g81WrpcETB5= =3Dw@mail.gmail.com Backpatch-through: 9.6 h= ttps://git.postgresql.org/pg/commitdiff/409f9ca4471331be0f77b665ff3a1836a41= de5b3

  • Block ALTER INDEX/TABLE index_name ALTER CO= LUMN colname SET (options). The grammar of this command run on indexes with column names has always been authorized by the parser, and it has never been documented. Since 911e70= 2, it is possible to define opclass parameters as of CREATE INDEX, which actual= ly broke the old case of ALTER INDEX/TABLE where relation-level parameters n_distinct and n_distinct_inherited could be defined for an index (see 76= a47c0 and its thread where this point has been touched, still remained unused). Attempting to do that in v13~ would cause the index to become unusable, as there is a new dedicated code path to load opclass parameters instead of = the relation-level ones previously available. Note that it is possible to fix things with a manual catalog update to bring the relation back online. T= his commit disables this command for now as the use of column names for index= es does not make sense anyway, particularly when it comes to index expressio= ns where names are automatically computed. One way to properly support this= case properly in the future would be to use column numbers when it comes to indexes, in the same way as ALTER INDEX .. ALTER COLUMN .. SET STATISTICS. Partitioned indexes were already blocked, but not indexes. Some tests are added for both cases. There was some code in ANALYZE to enforce n_distin= ct to be used for an index expression if the parameter was defined, but just re= move it for now until/if there is support for this (note that index-level parameters never had support in pg_dump either, previously), so this was = just dead code. Reported-by: Matthijs van der Vleuten Author: Nathan Bossart, Michael Paquier Reviewed-by: Vik Fearing, Dilip Kumar Discussion: https://postgr.es/m/17220= -15d684c6c2171a83@postgresql.org Backpatch-through: 13 h= ttps://git.postgresql.org/pg/commitdiff/fdd88571454e2b00dbe446e8609c6e4294c= a89ae

  • Fix build of MSVC with OpenSSL 3.0.0. The b= uild scripts of Visual Studio would fail to detect properly a 3.0.0 build as the check on the second digit was failing. This is adjusted where needed, allowing the builds to complete. Note that the MSIs of OpenSSL mentioned in the documentation have not cha= nged any library names for Win32 and Win64, making this change straight-forwar= d. Reported-by: htalaco, via github Reviewed-by: Daniel Gustafsson Discussio= n: https://postgr.es/m/YW5XKYkq6k7Otr= Fq@paquier.xyz Backpatch-through: 9.6 h= ttps://git.postgresql.org/pg/commitdiff/41f30ecc29c89285d3eecd435906c4e9cb0= 48be4

  • Fix corruption of pg_shdepend when copying = deps from template database. Using for a new database a template database with shared dependencies that need= to be copied over was causing a corruption of pg_shdepend because of an off-by-one computation error of the index number used for the values inse= rted with a slot. Issue introduced by e3931d0. Monitoring the rest of the co= de, there are no similar mistakes. Reported-by: Sven Klemm Author: Aleksander Alekseev Reviewed-by: Daniel Gustafsson, Michael Paquier Discussion: https://postgr.es/m/CAJ7c6TP0AowkUgNL6zcAK-s5HYsVHVBRWfu69FRubPpfwZGM9A= @mail.gmail.com Backpatch-through: 14 h= ttps://git.postgresql.org/pg/commitdiff/98ec35b0bbf6003e89fc06aa140e12fd90b= bad47

  • doc: Describe calculation method of streami= ng start for pg_receivewal. The documentation was imprecise about the starting LSN used for WAL streaming= if nothing can be found in the local archive directory defined with the pg_receivewal command, so be more talkative on this matter. Extracted fr= om a larger patch by the same author. Author: Ronan Dunklau, Michael Paquier Discussion: https://postgr.es/m/18708360.4lz= OvYHigE@aivenronan Backpatch-through: 10 h= ttps://git.postgresql.org/pg/commitdiff/1e9475694b0ae2cf1204d01d2ef6ad86f3c= 7cac8

Heikki Linnakangas pushed:

=C3=81lvaro Herrera pushed:

Daniel Gustafsson pushed:

  • Fix sscanf limits in pg_basebackup and pg_d= ump. Make sure that the string parsing is limited by the size of the destination buffer. In pg_baseback= up the available values sent from the server is limited to two characters so there was no risk of overflow. In pg_dump the buffer is bounded by MAXPG= PATH, and thus the limit must be inserted via preprocessor expansion and the bu= ffer increased by one to account for the terminator. There is no risk of overf= low here, since in this case, the buffer scanned is smaller than the destinat= ion buffer. Backpatch the pg_basebackup fix to 11 where it was introduced, a= nd the pg_dump fix all the way down to 9.6. Reviewed-by: Tom Lane Discussio= n: https://postgr.es= /m/B14D3D7B-F98C-4E20-9459-C122C67647FB@yesql.se Backpatch-through: 11 and 9.6 h= ttps://git.postgresql.org/pg/commitdiff/1d7641d51a51aa00dff685022fab6c03be8= f8af8

  • Fix bug in TOC file error message printing.= If the blob TOC file cannot be parsed, the error message was failing to print the filename as the variab= le holding it was shadowed by the destination buffer for parsing. When the filename fails to parse, the error will print an empty string: ./pg_res= tore -d foo -F d dump pg_restore: error: invalid line in large object TOC fil= e "": .. ..instead of the intended error message: ./pg_restore -d foo -F d d= ump pg_restore: error: invalid line in large object TOC file "dump/blobs.toc"= : .. Fix by renaming both variables as the shared name was too generic to store either and still convey what the variable held. Backpatch all the way do= wn to 9.6. Reviewed-by: Tom Lane Discussion: https://postgr.es= /m/A2B151F5-B32B-4F2C-BA4A-6870856D9BDE@yesql.se Backpatch-through: 9.6 h= ttps://git.postgresql.org/pg/commitdiff/998d060f3db79c6918cb4a547695be15083= 3f9a4

  • Refactor the sslfiles Makefile target for e= ase of use. The Makefile handling of certificate and keypairs used for TLS testing had become quite difficu= lt to work with. Adding a new cert without the need to regenerate everything wa= s too complicated. This patch refactors the sslfiles make target such that addi= ng a new certificate requires only adding a .config file, adding it to the top= of the Makefile, and running make sslfiles. Improvements: - Interfile dependencies should be fixed, with the exception of the CRL dirs. - New certificates have serial numbers based on the current time, reducing the chance of collision. - The CA index state is created on demand and cleane= d up automatically at the end of the Make run. - *.config files= are now self-contained; one certificate needs one config file instead of two. - Duplication is reduced, and along with it some unneeded code (and possi= ble copy-paste errors). - all configuration files underneath the conf/ direct= ory. The target is moved to its own makefile in order to avoid colliding with global make settings. Author: Jacob Champion pchampio= n@vmware.com Reviewed-by: Michael Paquier michael@paq&= #117;ier.xyz Discussion: https= ://postgr.es/m/d15a9838344ba090e09fd866abf913584ea19fb7.camel@vmware.com htt= ps://git.postgresql.org/pg/commitdiff/b4c4a00eada3c512e819e9163114a5ad1606b= c7e

  • Fix SSL tests on 32-bit Perl. The certifica= te serial number generation was changed in b4c4a00ea to use the current timestamp. The testharness must t= hus interrogate the cert for the serialnumber using "openssl x509" which emit= s the serial in hex format. Converting the serial to integer format to match wh= ats in pg_stat_ssl requires a 64-bit capable Perl. This adds a fallback to checking for an integer when the tests with a 32-bit Perl. Per failure on buildfarm member prairiedog. Discussion: https://postgr.es= /m/0D295F43-806D-4B3F-AB98-F941A19E0271@yesql.se htt= ps://git.postgresql.org/pg/commitdiff/0c04342b1d3dd5b24f795f94874163be8e217= 10e

Tom Lane pushed:

  • Remove bogus assertion in transformExpressi= onList(). I think when I added this assertion (in commit 8f889b108), I was only thinking of the use of transformExpressionList at top level of INSERT and VALUES. But it's also called by transformRowExpr(), which can certainly occur in an UPDATE targetlist, so it's inappropriate to suppose that p_multiassign_exprs mus= t be empty. Besides, since the input is not expected to contain ResTargets, there's no reason it should contain MultiAssignRefs either. Hence this c= ode need not be concerned about the state of p_multiassign_exprs, and we shou= ld just drop the assertion. Per bug #17236 from ocean_li_996. It's been wr= ong for years, so back-patch to all supported branches. Discussion: https://postgr.es/m/17236= -3210de9bcba1d7ca@postgresql.org htt= ps://git.postgresql.org/pg/commitdiff/697dd1925f418c9f54ee1fd1cefbc613d6504= b1f

  • Fix assignment to array of domain over comp= osite. An update such as "UPDATE ... SET fld[n].subfld =3D whatever" failed if the array elements were dom= ains rather than plain composites. That's because isAssignmentIndirectionExpr= () failed to cope with the CoerceToDomain node that would appear in the expression tree in this case. The result would typically be a crash, and= even if we accidentally didn't crash, we'd not correctly preserve other fields= of the same array element. Per report from Onder Kalaci. Back-patch to v11 where arrays of domains came in. Discussion: https://postgr.es/m/PH0PR21MB132823A46AA36F0685B7A29AD8BD9@= PH0PR21MB1328.namprd21.prod.outlook.com htt= ps://git.postgresql.org/pg/commitdiff/3e310d837a9b3de8ad977c0a3e2a769bcdf61= cc9

  • pg_dump: Reorganize getTables(). Along the = same lines as 047329624, ed2c7f65b and daa9fe8a5, reduce code duplication by having just one copy of the par= ts of the query that are the same across all server versions; and make the conditionals control the smallest possible amount of code. This also gets= rid of the confusing assortment of different ways to accomplish the same resu= lt that we had here before. While at it, make sure all three relevant parts= of the function list the fields in the same order. This is just neatnik-ism= , of course. Discussion: https://postgr.es/m/1240992.16= 34419055@sss.pgh.pa.us htt= ps://git.postgresql.org/pg/commitdiff/4438eb4a495c977d8ac485dd6e544c2b6e077= deb

  • Improve pg_regress.c's infrastructure for i= ssuing psql commands. Support issuing more than one "-c command" switch to a single psql invocation. T= his allows combining some things that formerly required two or more backend launches into a single session. In particular, we can issue DROP DATABASE= as one of the -c commands without getting "DROP DATABASE cannot run inside a transaction block". In addition to reducing the number of sessions neede= d, this patch also suppresses "NOTICE: database "foo" does not exist, skipp= ing" chatter that was formerly generated during pg_regress's DROP DATABASE (or ROLE) IF NOT EXISTS calls. That moves us another step closer to the idea= l of not seeing any messages during successful build/test. This also eliminat= es some hard-coded restrictions on the length of the commands issued. I don= 't think we were anywhere near hitting those, but getting rid of the limit is comforting. Patch by me, but thanks to Nathan Bossart for starting the discussion. Discussion: https://postgr.= es/m/DCBAE0E4-BD56-482F-8A70-7FD0DC0860BE@amazon.com htt= ps://git.postgresql.org/pg/commitdiff/f45dc59a38cab1d2af6baaedb79559fe2e9b3= 781

  • Doc: clarify a critical and undocumented as= pect of simplehash.h. I just got burnt by trying to use pg_malloc instead of pg_malloc0 with this. Save t= he next hacker some time by not leaving this API detail undocumented. h= ttps://git.postgresql.org/pg/commitdiff/b1ce6c284366ce1dae120f5d10dd59e8804= 322ee

  • pg_dump: fix mis-dumping of non-global defa= ult privileges. Non-global default privilege entries should be dumped as-is, not made relative to the defaul= t ACL for their object type. This would typically only matter if one had revoked some on-by-default privileges in a global entry, and then wanted to grant= them again in a non-global entry. Per report from Boris Korzun. This is an o= ld bug, so back-patch to all supported branches. Neil Chen, test case by Masahiko Sawada Discussion: https://postgr.es/m/111621616618= 184@mail.yandex.ru Discussion: https://postgr.es/m/CAA3qoJnr2+1dVJObNtfec=3DqW4Z0nz=3DA9+r5bZKoTSy= 5RDjskMw@mail.gmail.com htt= ps://git.postgresql.org/pg/commitdiff/2acc84c6fd299125702c8a8af13820abcc0d4= 891

  • Fix frontend version of sh_error() in simpl= ehash.h. The code does not expect sh_error() to return, but the patch that made this header usable in front= end didn't get that memo. While here, plaster unlikely() on the tests that d= ecide whether to invoke sh_error(), and add our standard copyright notice. Not= ed by Andres Freund. Back-patch to v13 where this frontend support came in. Discussion: https://postgr= .es/m/0D54435C-1199-4361-9D74-2FBDCF8EA164@anarazel.de htt= ps://git.postgresql.org/pg/commitdiff/974aedcea46dfd0119eea2fbb2eeacd232596= f05

  • In pg_dump, use simplehash.h to look up dum= pable objects by OID. Create a hash table that indexes dumpable objects by CatalogId (that is, catalog OID + object OID). Use this to replace the former catalogIdMap array, as well = as various other single- catalog index arrays, and also the extension member= ship map. In principle this should be faster for databases with many objects, since lookups are now O(1) not O(log N). However, it seems that these lo= okups are pretty much negligible in context, so that no overall performance cha= nge can be measured. But having only one lookup data structure to maintain m= akes the code simpler and more flexible, so let's do it anyway. Discussion: https://postgr.es/m/2595220.16= 34855245@sss.pgh.pa.us htt= ps://git.postgresql.org/pg/commitdiff/92316a4582a5714d4e494aaf90360860e7fec= 37a

  • Fix minor memory leaks in pg_dump. I found = these by running pg_dump under "valgrind --leak-check=3Dfull". The changes in flagInhIndexes() and getIndexes() replace allocation of an array of which we use only some ele= ments by individual allocations of just the actually-needed objects. The previ= ous coding wasted some memory, but more importantly it confused valgrind's le= ak tracking. collectComments() and collectSecLabels() remain major blots on= the valgrind report, because they don't PQclear their query results, in order= to avoid a lot of strdup's. That's a dubious tradeoff, but I'll leave it al= one here; an upcoming patch will modify those functions enough to justify cha= nging the tradeoff. h= ttps://git.postgresql.org/pg/commitdiff/70bef494000e4dbbeca0f0a40347ca1747a= ea701

Andres Freund pushed:

Amit Kapila pushed:

Andrew Dunstan pushed:

Noah Misch pushed:

  • Avoid race in RelationBuildDesc() affecting= CREATE INDEX CONCURRENTLY. CIC and REINDEX CONCURRENTLY assume backends see their catalog changes no later t= han each backend's next transaction start. That failed to hold when a backend absorbed a relevant invalidation in the middle of running RelationBuildDe= sc() on the CIC index. Queries that use the resulting index can silently fail= to find rows. Fix this for future index builds by making RelationBuildDesc() loop until it finishes without accepting a relevant invalidation. It may= be necessary to reindex to recover from past occurrences; REINDEX CONCURRENT= LY suffices. Back-patch to 9.6 (all supported versions). Noah Misch and And= rey Borodin, reviewed (in earlier versions) by Andres Freund. Discussion: https://postgr.es/m/= 20210730022548.GA1940096@gust.leadboat.com htt= ps://git.postgresql.org/pg/commitdiff/fdd965d074d46765c295223b119ca437dbcac= 973

  • Fix CREATE INDEX CONCURRENTLY for the newes= t prepared transactions. The purpose of commit 8a54e12a38d1545d249f1402f66c8cde2837d97c was to fix thi= s, and it sufficed when the PREPARE TRANSACTION completed before the CIC loo= ked for lock conflicts. Otherwise, things still broke. As before, in a clus= ter having used CIC while having enabled prepared transactions, queries that = use the resulting index can silently fail to find rows. It may be necessary = to reindex to recover from past occurrences; REINDEX CONCURRENTLY suffices. = Fix this for future index builds by making CIC wait for arbitrarily-recent prepared transactions and for ordinary transactions that may yet PREPARE TRANSACTION. As part of that, have PREPARE TRANSACTION transfer locks to= its dummy PGPROC before it calls ProcArrayClearTransaction(). Back-patch to = 9.6 (all supported versions). Andrey Borodin, reviewed (in earlier versions)= by Andres Freund. Discussion: https://pos= tgr.es/m/01824242-AA92-4FE9-9BA7-AEBAFFEA3D0C@yandex-team.ru htt= ps://git.postgresql.org/pg/commitdiff/3cd9c3b921977272e6650a5efbeade4203c4b= ca2

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/.
 
--===============7047657102201655424==-- --===============2937662810589799231==--