PostgreSQL Weekly News - July 4, 2021

From: PWN via PostgreSQL Announce <announce-noreply(at)postgresql(dot)org>
To: PostgreSQL Announce <pgsql-announce(at)lists(dot)postgresql(dot)org>
Subject: PostgreSQL Weekly News - July 4, 2021
Date: 2021-07-05 09:35:30
Message-ID: 162547773008.701.36096961864822155@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce

# PostgreSQL Weekly News - July 4, 2021

Congratulations to the new PostgreSQL committers, Daniel Gustafsson and John Naylor!

# PostgreSQL Product News

pg_dumpbinary 2.4, a program used to dump a PostgreSQL database in binary
format, released.
[https://github.com/lzlabs/pg_dumpbinary/releases/](https://github.com/lzlabs/pg_dumpbinary/releases/)

# PostgreSQL Jobs for July

[https://archives.postgresql.org/pgsql-jobs/2021-07/](https://archives.postgresql.org/pgsql-jobs/2021-07/)

# PostgreSQL in the News

Planet PostgreSQL: [https://planet.postgresql.org/](https://planet.postgresql.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(at)fetter(dot)org(dot)

# Applied Patches

Michaël Paquier pushed:

- Add test for CREATE INDEX CONCURRENTLY with not-so-immutable predicate.
83158f7 has improved index_set_state_flags() so as it is possible to use
transactional updates when updating pg_index state flags, but there was not
really a test case which stressed directly the possibility it fixed. This
commit adds such a test, using a predicate that looks valid in appearance but
calls a stable function. Author: Andrey Lepikhov Discussion:
[https://postgr.es/m/9b905019-5297-7372-0ad2-e1a4bb66a719@postgrespro.ru](https://postgr.es/m/9b905019-5297-7372-0ad2-e1a4bb66a719@postgrespro.ru)
Backpatch-through: 9.6
[https://git.postgresql.org/pg/commitdiff/09a69f6e23369847cf11cd03c999a0342d47bbcc](https://git.postgresql.org/pg/commitdiff/09a69f6e23369847cf11cd03c999a0342d47bbcc)

- Fix variable initialization with ALTER SUBSCRIPTION DROP PUBLICATION.
copy_data is not a supported option with this sub-command of ALTER
SUBSCRIPTION, which would not make a variable related to it initialized after
parsing the option set in DefElems. A refresh could then refer to it.
Author: Ranier Vilela Reviewed-by: Peter Smith Discussion:
[https://postgr.es/m/CAEudQAp5P8nr=ze2Gv=BMj=DJFZnrvendZCZcC-fos3QiDe2sg@mail.gmail.com](https://postgr.es/m/CAEudQAp5P8nr=ze2Gv=BMj=DJFZnrvendZCZcC-fos3QiDe2sg@mail.gmail.com)
[https://git.postgresql.org/pg/commitdiff/79718c1c6c007c27e9c1b8e92bd96d17067606fa](https://git.postgresql.org/pg/commitdiff/79718c1c6c007c27e9c1b8e92bd96d17067606fa)

- Add support for LZ4 with compression of full-page writes in WAL. The logic is
implemented so as there can be a choice in the compression used when building
a WAL record, and an extra per-record bit is used to track down if a block is
compressed with PGLZ, LZ4 or nothing. wal_compression, the existing
parameter, is changed to an enum with support for the following
backward-compatible values: - "off", the default, to not use compression. -
"pglz" or "on", to compress FPWs with PGLZ. - "lz4", the new mode, to compress
FPWs with LZ4. Benchmarking has showed that LZ4 outclasses easily PGLZ. ZSTD
would be also an interesting choice, but going just with LZ4 for now makes the
patch minimalistic as toast compression is already able to use LZ4, so there
is no need to worry about any build-related needs for this implementation.
Author: Andrey Borodin, Justin Pryzby Reviewed-by: Dilip Kumar, Michael
Paquier Discussion:
[https://postgr.es/m/3037310D-ECB7-4BF1-AF20-01C10BB33A33@yandex-team.ru](https://postgr.es/m/3037310D-ECB7-4BF1-AF20-01C10BB33A33@yandex-team.ru)
[https://git.postgresql.org/pg/commitdiff/4035cd5d4eee4dae797bfc77ab07f8dcd8781b41](https://git.postgresql.org/pg/commitdiff/4035cd5d4eee4dae797bfc77ab07f8dcd8781b41)

- Fix compilation warning in xloginsert.c. This is reproducible with gcc using
at least -O0. The last checks validating the compression of a block could not
be reached with this variable not set, but let's be clean. Oversight in
4035cd5, per buildfarm member lapwing.
[https://git.postgresql.org/pg/commitdiff/47f514dd9a0022a04d321b627b2e991cb85396e2](https://git.postgresql.org/pg/commitdiff/47f514dd9a0022a04d321b627b2e991cb85396e2)

- Bump XLOG_PAGE_MAGIC for format changes related to FPW compression. Oversight
in 4035cd5, spotted by Tom Lane. Discussion:
[https://postgr.es/m/365778.1624941613@sss.pgh.pa.us](https://postgr.es/m/365778.1624941613@sss.pgh.pa.us)
[https://git.postgresql.org/pg/commitdiff/445e36ad4e14480a3c97d0f973a3532912424e85](https://git.postgresql.org/pg/commitdiff/445e36ad4e14480a3c97d0f973a3532912424e85)

- Optimize pg_checksums --enable where checksum is already set. This commit
prevents pg_checksums to do a rewrite of a block if it has no need to, in the
case where the computed checksum matches with what's already stored in the
block read. This is helpful to accelerate successive runs of the tool when
the previous ones got interrupted, for example. The number of blocks and
files written is tracked and reported by the tool once finished. Note that
the final flush of the data folder happens even if no blocks are written, as
it could be possible that a previous interrupted run got stopped while doing a
flush. Author: Greg Sabino Mullane Reviewed-by: Paquier Michael, Julien
Rouhaud Discussion:
[https://postgr.es/m/CAKAnmmL+k6goxmVzQJB+0bAR0PN1sgo6GDUXJhyhUmVMze1QAw@mail.gmail.com](https://postgr.es/m/CAKAnmmL+k6goxmVzQJB+0bAR0PN1sgo6GDUXJhyhUmVMze1QAw@mail.gmail.com)
[https://git.postgresql.org/pg/commitdiff/4c9f50d116461617848601e97dbc6f122b0a6f14](https://git.postgresql.org/pg/commitdiff/4c9f50d116461617848601e97dbc6f122b0a6f14)

- Fix incorrect PITR message for transaction ROLLBACK PREPARED. Reaching PITR on
such a transaction would cause the generation of a LOG message mentioning a
transaction committed, not aborted. Oversight in 4f1b890. Author: Simon
Riggs Discussion:
[https://postgr.es/m/CANbhV-GJ6KijeCgdOrxqMCQ+C8QiK657EMhCy4csjrPcEUFv_Q@mail.gmail.com](https://postgr.es/m/CANbhV-GJ6KijeCgdOrxqMCQ+C8QiK657EMhCy4csjrPcEUFv_Q@mail.gmail.com)
Backpatch-through: 9.6
[https://git.postgresql.org/pg/commitdiff/17707c059cf4bf610e3b1833df5ca17cf223fe5f](https://git.postgresql.org/pg/commitdiff/17707c059cf4bf610e3b1833df5ca17cf223fe5f)

- Simplify error handing of jsonapi.c for the frontend. This commit removes a
dependency to the central logging facilities in the JSON parsing routines of
src/common/, which existed to log errors when seeing error codes that do not
match any existing values in JsonParseErrorType, which is not something that
should never happen. The routine providing a detailed error message based on
the error code is made backend-only, the existing code being unsafe to use in
the frontend as the error message may finish by being palloc'd or point to a
static string, so there is no way to know if the memory of the message should
be pfree'd or not. The only user of this routine in the frontend was
pg_verifybackup, that is changed to use a more generic error message on
parsing failure. Note that making this code more resilient to OOM failures if
used in shared libraries would require much more work as a lot of code paths
still rely on palloc() & friends, but we are not sure yet if we need to go
down to that. Still, removing the dependency to logging is a step toward more
portability. This cleans up the handling of check_stack_depth() while on it,
as it exists only in the backend. Per discussion with Jacob Champion and Tom
Lane. Discussion:
[https://postgr.es/m/YNwL7kXwn3Cckbd6@paquier.xyz](https://postgr.es/m/YNwL7kXwn3Cckbd6@paquier.xyz)
[https://git.postgresql.org/pg/commitdiff/b44669b2ca6a510b2c81cbe74c704d59226d729c](https://git.postgresql.org/pg/commitdiff/b44669b2ca6a510b2c81cbe74c704d59226d729c)

- Use WaitLatch() instead of pg_usleep() at end-of-vacuum truncation. This has
the advantage to make a process more responsive when the postmaster dies, even
if the wait time was rather limited as there was only a 50ms timeout here.
Another advantage of this change is for monitoring, as we gain a new wait
event for the end-of-vacuum truncation. Author: Bharath Rupireddy
Reviewed-by: Aleksander Alekseev, Thomas Munro, Michael Paquier Discussion:
[https://postgr.es/m/CALj2ACU4AdPCq6NLfcA-ZGwX7pPCK5FgEj-CAU0xCKzkASSy_A@mail.gmail.com](https://postgr.es/m/CALj2ACU4AdPCq6NLfcA-ZGwX7pPCK5FgEj-CAU0xCKzkASSy_A@mail.gmail.com)
[https://git.postgresql.org/pg/commitdiff/70685385d70f8da73ab189a72f46311091ff09be](https://git.postgresql.org/pg/commitdiff/70685385d70f8da73ab189a72f46311091ff09be)

- doc: Mention requirement to --enable-tap-tests on section for TAP tests.
Author: Greg Sabino Mullane Discussion:
[https://postgr.es/m/CAKAnmmJYH2FBn_+Vwd2FD5SaKn8hjhAXOCHpZc6n4wXaUaW_SA@mail.gmail.com](https://postgr.es/m/CAKAnmmJYH2FBn_+Vwd2FD5SaKn8hjhAXOCHpZc6n4wXaUaW_SA@mail.gmail.com)
Backpatch-through: 9.6
[https://git.postgresql.org/pg/commitdiff/0f06359fb3622b289485306727300dd31f96fd9d](https://git.postgresql.org/pg/commitdiff/0f06359fb3622b289485306727300dd31f96fd9d)

Thomas Munro pushed:

- Change recovery_init_sync_method to PGC_SIGHUP. The setting has no effect
except during startup. It's still nice to be able to change it dynamically,
which is expected to be pretty useful to an admin following crash recovery
when restarting the cluster is not so appealing. Per discussions following
commits 2941138e6 and 61752afb2. Author: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> Reviewed-by: Michael
Paquier <michael(at)paquier(dot)xyz> Reviewed-by: Thomas Munro
<thomas(dot)munro(at)gmail(dot)com> Discussion:
[https://postgr.es/m/20210529192321.GM2082%40telsasoft.com](https://postgr.es/m/20210529192321.GM2082%40telsasoft.com)
[https://git.postgresql.org/pg/commitdiff/34a8b64b4e5f0cd818e5cc7f98846de57938ea57](https://git.postgresql.org/pg/commitdiff/34a8b64b4e5f0cd818e5cc7f98846de57938ea57)

- Remove some dead stores. Remove redundant local variable assignments left
behind by commit 2fc7af5e966. Author: Quan Zongliang <quanzongliang(at)yeah(dot)net>
Reviewed-by: Jacob Champion <pchampion(at)vmware(dot)com> Discussion:
[https://postgr.es/m/de141d14-4fd6-3148-99bf-856b71aa948a%40yeah.net](https://postgr.es/m/de141d14-4fd6-3148-99bf-856b71aa948a%40yeah.net)
[https://git.postgresql.org/pg/commitdiff/a2595e039c4745d82f361ea15d692cac114575cc](https://git.postgresql.org/pg/commitdiff/a2595e039c4745d82f361ea15d692cac114575cc)

Amit Kapila pushed:

- Fix race condition in TransactionGroupUpdateXidStatus(). When we cannot
immediately acquire XactSLRULock in exclusive mode at commit time, we add
ourselves to a list of processes that need their XIDs status update. We do
this if the clog page where we need to update the current transaction status
is the same as the group leader's clog page, otherwise, we allow the caller to
clear it by itself. Now, when we can't add ourselves to any group, we were not
clearing the current proc if it has already become a member of some group
which was leading to an assertion failure when the same proc was assigned to
another backend after the current backend exits. Reported-by: Alexander
Lakhin Bug: 17072 Author: Amit Kapila Tested-By: Alexander Lakhin
Backpatch-through: 11, where it was introduced Discussion:
[https://postgr.es/m/17072-2f8764857ef2c92a@postgresql.org](https://postgr.es/m/17072-2f8764857ef2c92a@postgresql.org)
[https://git.postgresql.org/pg/commitdiff/b786304c2904a4e444fe740bbc2e0b69efacc19d](https://git.postgresql.org/pg/commitdiff/b786304c2904a4e444fe740bbc2e0b69efacc19d)

- Improve RelationGetIdentityKeyBitmap(). We were using RelationGetIndexList()
to update the relation's replica identity index but instead, we can directly
use RelationGetReplicaIndex() which uses the same functionality. This is a
minor code readability improvement. Author: Japin Li Reviewed-By: Takamichi
Osumi, Amit Kapila Discussion:
[https://postgr.es/m/4C99A862-69C8-431F-960A-81B1151F1B89@enterprisedb.com](https://postgr.es/m/4C99A862-69C8-431F-960A-81B1151F1B89@enterprisedb.com)
[https://git.postgresql.org/pg/commitdiff/ee3fdb8f3465b3a5937a7fe647b7b6584a600647](https://git.postgresql.org/pg/commitdiff/ee3fdb8f3465b3a5937a7fe647b7b6584a600647)

- Allow enabling two-phase option via replication protocol. Extend the
replication command CREATE_REPLICATION_SLOT to support the TWO_PHASE option.
This will allow decoding commands like PREPARE TRANSACTION, COMMIT PREPARED
and ROLLBACK PREPARED for slots created with this option. The decoding of the
transaction happens at prepare command. This patch also adds support of
two-phase in pg_recvlogical via a new option --two-phase. This option will
also be used by future patches that allow streaming of transactions at prepare
time for built-in logical replication. With this, the out-of-core logical
replication solutions can enable replication of two-phase transactions via
replication protocol. Author: Ajin Cherian Reviewed-By: Jeff Davis, Vignesh
C, Amit Kapila Discussion:
[https://postgr.es/m/02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru](https://postgr.es/m/02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru)
[https://postgr.es/m/64b9f783c6e125f18f88fbc0c0234e34e71d8639.camel@j-davis.com](https://postgr.es/m/64b9f783c6e125f18f88fbc0c0234e34e71d8639.camel@j-davis.com)
[https://git.postgresql.org/pg/commitdiff/cda03cfed6b8bd5f64567bccbc9578fba035691e](https://git.postgresql.org/pg/commitdiff/cda03cfed6b8bd5f64567bccbc9578fba035691e)

- Allow streaming the changes after speculative aborts. Until now, we didn't
allow to stream the changes in logical replication till we receive speculative
confirm or the next DML change record after speculative inserts. The reason
was that we never use to process speculative aborts but after commit
4daa140a2f it is possible to process them so we can allow streaming once we
receive speculative abort after speculative insertion. We decided to
backpatch to 14 where the feature for streaming in progress transactions have
been introduced as this is a minor change and makes that functionality better.
Author: Amit Kapila Reviewed-By: Dilip Kumar Backpatch-through: 14 Discussion:
[https://postgr.es/m/CAA4eK1KdqmTCtrBR6oFfGELrLLbDLDedL6zACcsUOQuTJBj1vw@mail.gmail.com](https://postgr.es/m/CAA4eK1KdqmTCtrBR6oFfGELrLLbDLDedL6zACcsUOQuTJBj1vw@mail.gmail.com)
[https://git.postgresql.org/pg/commitdiff/52d26d560e272613c501e35b24fbf8d710de4b8a](https://git.postgresql.org/pg/commitdiff/52d26d560e272613c501e35b24fbf8d710de4b8a)

- Replace magic constants used in pg_stat_get_replication_slot(). A few
variables have been using 10 as a magic constant while
PG_STAT_GET_REPLICATION_SLOT_COLS can be used instead. Author: Masahiko
Sawada Reviewed-By: Amit Kapila Backpatch-through: 14, where it was introduced
Discussion:
[https://postgr.es/m/CAD21AoBvqODDfmD17DkEuPCvV2KbruukXQ2Vwrv5Xi-TsAsTJA@mail.gmail.com](https://postgr.es/m/CAD21AoBvqODDfmD17DkEuPCvV2KbruukXQ2Vwrv5Xi-TsAsTJA@mail.gmail.com)
[https://git.postgresql.org/pg/commitdiff/ab5e48f153cfea2c571dc177ae96faf4ab072b8e](https://git.postgresql.org/pg/commitdiff/ab5e48f153cfea2c571dc177ae96faf4ab072b8e)

Peter Eisentraut pushed:

- Message style improvements.
[https://git.postgresql.org/pg/commitdiff/c31833779d5a4775d7220be4b9143bec66c9a9fd](https://git.postgresql.org/pg/commitdiff/c31833779d5a4775d7220be4b9143bec66c9a9fd)

- Add index OID macro argument to DECLARE_INDEX. Instead of defining symbols
such as AmOidIndexId explicitly, include them as an argument of
DECLARE_INDEX() and have genbki.pl generate the way as the table OID symbols
from the CATALOG() declaration. Reviewed-by: John Naylor
<john(dot)naylor(at)enterprisedb(dot)com> Discussion:
[https://www.postgresql.org/message-id/flat/ccef1e46-a404-25b1-9b4c-85f2c08e1f28%40enterprisedb.com](https://www.postgresql.org/message-id/flat/ccef1e46-a404-25b1-9b4c-85f2c08e1f28%40enterprisedb.com)
[https://git.postgresql.org/pg/commitdiff/6a6389a08b228aa6bd21ced7a9c5151bf6f7f0a2](https://git.postgresql.org/pg/commitdiff/6a6389a08b228aa6bd21ced7a9c5151bf6f7f0a2)

- genbki stricter error handling. Instead of just writing warnings for invalid
cross-catalog lookups, count the errors and error out at the end.
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> Discussion:
[https://www.postgresql.org/message-id/flat/ca8ee41d-241b-1bf3-71f0-aaf1add6d3c5%40enterprisedb.com](https://www.postgresql.org/message-id/flat/ca8ee41d-241b-1bf3-71f0-aaf1add6d3c5%40enterprisedb.com)
[https://git.postgresql.org/pg/commitdiff/735dc1a09469002fd659a4b1f5d582377b318977](https://git.postgresql.org/pg/commitdiff/735dc1a09469002fd659a4b1f5d582377b318977)

- Add tests for UNBOUNDED syntax ambiguity. There is a syntactic ambiguity in
the SQL standard. Since UNBOUNDED is a non-reserved word, it could be the
name of a function parameter and be used as an expression. There is a grammar
hack to resolve such cases as the keyword. Add some tests to record this
behavior. Reviewed-by: Heikki Linnakangas <hlinnaka(at)iki(dot)fi> Discussion:
[https://www.postgresql.org/message-id/flat/b2a09a77-3c8f-7c68-c9b7-824054f87d98%40enterprisedb.com](https://www.postgresql.org/message-id/flat/b2a09a77-3c8f-7c68-c9b7-824054f87d98%40enterprisedb.com)
[https://git.postgresql.org/pg/commitdiff/71ba45a3602da0bdbb518e16e3990cfcf21e5f73](https://git.postgresql.org/pg/commitdiff/71ba45a3602da0bdbb518e16e3990cfcf21e5f73)

- doc: Clean up title case use.
[https://git.postgresql.org/pg/commitdiff/c0fdc963704983ebd5908dc5acfb4d52303091a4](https://git.postgresql.org/pg/commitdiff/c0fdc963704983ebd5908dc5acfb4d52303091a4)

- doc: Remove inappropriate <acronym> tags.
[https://git.postgresql.org/pg/commitdiff/1708f6b38aaf1b9375b5ca82792425410c98d441](https://git.postgresql.org/pg/commitdiff/1708f6b38aaf1b9375b5ca82792425410c98d441)

- Use InvalidBucket instead of -1 where appropriate. Reported-by: Ranier Vilela
<ranier(dot)vf(at)gmail(dot)com> Discussion:
[https://www.postgresql.org/message-id/flat/CAEudQAp%3DZwKjrP4L%2BCzqV7SmWiaQidPPRqj4tqdjDG4KBx5yrg%40mail.gmail.com](https://www.postgresql.org/message-id/flat/CAEudQAp%3DZwKjrP4L%2BCzqV7SmWiaQidPPRqj4tqdjDG4KBx5yrg%40mail.gmail.com)
[https://git.postgresql.org/pg/commitdiff/6bd3ec62d9d7921fad2125bbeb5f2eafbbb261e5](https://git.postgresql.org/pg/commitdiff/6bd3ec62d9d7921fad2125bbeb5f2eafbbb261e5)

Andrew Dunstan pushed:

- Pre branch pgindent / pgperltidy run. Along the way make a slight adjustment
to src/include/utils/queryjumble.h to avoid an unused typedef.
[https://git.postgresql.org/pg/commitdiff/e1c1c30f635390b6a3ae4993e8cac213a33e6e3f](https://git.postgresql.org/pg/commitdiff/e1c1c30f635390b6a3ae4993e8cac213a33e6e3f)

- Stamp HEAD as 15devel. Let the hacking begin ...
[https://git.postgresql.org/pg/commitdiff/596b5af1d3675b58d4018acd64217e2f627da3e4](https://git.postgresql.org/pg/commitdiff/596b5af1d3675b58d4018acd64217e2f627da3e4)

- Fix prove_installcheck to use correct paths when used with PGXS. The
prove_installcheck recipe in src/Makefile.global.in was emitting bogus paths
for a couple of elements when used with PGXS. Here we create a separate recipe
for the PGXS case that does it correctly. We also take the opportunity to make
the make the file more readable by breaking up the prove_installcheck and
prove_check recipes across several lines, and to remove the setting for
REGRESS_SHLIB to src/test/recovery/Makefile, which is the only set of tests
that actually need it. Backpatch to all live branches Discussion:
[https://postgr.es/m/f2401388-936b-f4ef-a07c-a0bcc49b3300@dunslane.net](https://postgr.es/m/f2401388-936b-f4ef-a07c-a0bcc49b3300@dunslane.net)
[https://git.postgresql.org/pg/commitdiff/a0fc813266467d666b8f09ccccaccb700326a296](https://git.postgresql.org/pg/commitdiff/a0fc813266467d666b8f09ccccaccb700326a296)

- Add new make targets world-bin and install-world-bin. These are the same as
world and install-world respectively, but without building or installing the
documentation. There are many reasons for wanting to be able to do this,
including speed, lack of documentation building tools, and wanting to build
other formats of the documentation. Plans for simplifying the buildfarm client
code include using these targets. Backpatch to all live branches.
Discussion:
[https://postgr.es/m/6a421136-d462-b043-a8eb-e75b2861f3df@dunslane.net](https://postgr.es/m/6a421136-d462-b043-a8eb-e75b2861f3df@dunslane.net)
[https://git.postgresql.org/pg/commitdiff/b8c4261e5e8dc5c20d033970ec584991638ca041](https://git.postgresql.org/pg/commitdiff/b8c4261e5e8dc5c20d033970ec584991638ca041)

- add missing tag from commit b8c4261e5e.
[https://git.postgresql.org/pg/commitdiff/7355c241ed002496d70882eccea6027726e2fb5a](https://git.postgresql.org/pg/commitdiff/7355c241ed002496d70882eccea6027726e2fb5a)

Peter Geoghegan pushed:

- Add pgindent commit to git-blame-ignore-revs file. Add entry for recent commit
e1c1c30f.
[https://git.postgresql.org/pg/commitdiff/ba135fa537ab5c2fca0d589c826ebb3ecf98b2f1](https://git.postgresql.org/pg/commitdiff/ba135fa537ab5c2fca0d589c826ebb3ecf98b2f1)

- Improve pgindent release workflow. Update RELEASE_CHANGES to direct the reader
towards completing the steps outlined in the pgindent README, both as a
pre-beta task and as a task to be performed when starting a new development
cycle. This makes it less likely that somebody will miss updating the
.git-blame-ignore-revs file when running pgindent against the tree as a
routine release change task. Author: Peter Geoghegan <pg(at)bowt(dot)ie>
Reviewed-By: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> Discussion:
[https://postgr.es/m/CAH2-Wz=2PjF4As8dWECArsXxLKganYmQ-s0UeGqHHbHhqDKqeA@mail.gmail.com](https://postgr.es/m/CAH2-Wz=2PjF4As8dWECArsXxLKganYmQ-s0UeGqHHbHhqDKqeA@mail.gmail.com)
[https://git.postgresql.org/pg/commitdiff/bc49ab3c277b6b478bdad80c1ae36f926a33b4a6](https://git.postgresql.org/pg/commitdiff/bc49ab3c277b6b478bdad80c1ae36f926a33b4a6)

Tom Lane pushed:

- Don't depend on -fwrapv semantics in pgbench's random() function. Instead use
the common/int.h functions to check for integer overflow in a more
C-standard-compliant fashion. This is motivated by recent failures on
buildfarm member moonjelly, where it appears that development-tip gcc is
optimizing without regard to the -fwrapv switch. Presumably that's a gcc bug
that will be fixed soon, but we might as well install cleaner coding here
rather than wait. (This does not address the question of whether we'll ever
be able to get rid of using -fwrapv. Testing shows that this spot is the only
place where doing so creates visible regression test failures, but
unfortunately that proves very little.) Back-patch to v12. The common/int.h
functions exist in v11, but that branch doesn't use them in any client-side
code. I judge that this case isn't interesting enough in the real world to
take even a small risk of issues from being the first such use. Tom Lane and
Fabien Coelho Discussion:
[https://postgr.es/m/73927.1624815543@sss.pgh.pa.us](https://postgr.es/m/73927.1624815543@sss.pgh.pa.us)
[https://git.postgresql.org/pg/commitdiff/01697e92a460b10fde43707b29391c8deb69573e](https://git.postgresql.org/pg/commitdiff/01697e92a460b10fde43707b29391c8deb69573e)

- Don't use abort(3) in libpq's fe-print.c. Causing a core dump on out-of-memory
seems pretty unfriendly, and surely is far outside the expected behavior of a
general-purpose library. Just print an error message (as we did already) and
return. These functions unfortunately don't have an error return convention,
but code using them is probably just looking for a quick-n-dirty print method
and wouldn't bother to check anyway. Although these functions are
semi-deprecated, it still seems appropriate to back-patch this. In passing,
also back-patch b90e6cef1, just to reduce cosmetic differences between the
branches. Discussion:
[https://postgr.es/m/3122443.1624735363@sss.pgh.pa.us](https://postgr.es/m/3122443.1624735363@sss.pgh.pa.us)
[https://git.postgresql.org/pg/commitdiff/6f5d9bce57a7bb29ba61f0bf4fd465a26de9fc28](https://git.postgresql.org/pg/commitdiff/6f5d9bce57a7bb29ba61f0bf4fd465a26de9fc28)

- Doc: further updates for RELEASE_CHANGES process notes. Mention expectations
for email notifications of appropriate lists when a branch is made or retired.
(I've been doing that informally for years, but it's better to have it written
down.)
[https://git.postgresql.org/pg/commitdiff/14b2ffaf7ffdd199937e8bcba8b459da5491bcb6](https://git.postgresql.org/pg/commitdiff/14b2ffaf7ffdd199937e8bcba8b459da5491bcb6)

- Remove libpq's use of abort(3) to handle mutex failure cases. Doing an abort()
seems all right in development builds, but not in production builds of
general-purpose libraries. However, the functions that were doing this lack
any way to report a failure back up to their callers. It seems like we can
just get away with ignoring failures in production builds, since (a) no such
failures have been reported in the dozen years that the code's been like this,
and (b) failure to enforce mutual exclusion during fe-auth.c operations would
likely not cause any problems anyway in most cases. (The OpenSSL callbacks
that use this macro are obsolete, so even less likely to cause interesting
problems.) Possibly a better answer would be to break compatibility of the
pgthreadlock_t callback API, but in the absence of field problem reports, it
doesn't really seem worth the trouble. Discussion:
[https://postgr.es/m/3131385.1624746109@sss.pgh.pa.us](https://postgr.es/m/3131385.1624746109@sss.pgh.pa.us)
[https://git.postgresql.org/pg/commitdiff/aaddf6ba09e25878e792f0d15f725370e19396df](https://git.postgresql.org/pg/commitdiff/aaddf6ba09e25878e792f0d15f725370e19396df)

- Add a build-time check that libpq doesn't call exit() or abort(). Directly
exiting or aborting seems like poor form for a general-purpose library. Now
that libpq liberally uses bits out of src/common/, it's very easy to
accidentally include code that would do something unwanted like calling
exit(1) after OOM --- see for example 8ec00dc5c. Hence, add a simple
cross-check that no such calls have made it into libpq.so. The cross-check
depends on nm(1) being available and being able to work on a shared library,
which probably isn't true everywhere. But we can just make the test silently
do nothing if nm fails. As long as the check is effective on common platforms,
that should be good enough. (By the same logic, I've not worried about
providing an equivalent test in MSVC builds.) Discussion:
[https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us](https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us)
[https://git.postgresql.org/pg/commitdiff/dc227eb82ea8bf6919cd81a182a084589ddce7f3](https://git.postgresql.org/pg/commitdiff/dc227eb82ea8bf6919cd81a182a084589ddce7f3)

- Fix bogus logic for reporting which hash partition conflicts. Commit efbfb6424
added logic for reporting exactly which existing partition conflicts when
complaining that a new hash partition's modulus isn't compatible with the
existing ones. However, it misunderstood the partitioning data structure, and
would select the wrong partition in some cases, or crash outright due to
fetching a bogus table OID in other cases. Per bug #17076 from Alexander
Lakhin. Fix by Amit Langote; some further work on the code comments by me.
Discussion:
[https://postgr.es/m/17076-89a16ae835d329b9@postgresql.org](https://postgr.es/m/17076-89a16ae835d329b9@postgresql.org)
[https://git.postgresql.org/pg/commitdiff/dd2364ced98553e0217bfe8f621cd4b0970db74a](https://git.postgresql.org/pg/commitdiff/dd2364ced98553e0217bfe8f621cd4b0970db74a)

- Fix portability fallout from commit dc227eb82. Give up on trying to
mechanically forbid abort() within libpq. Even though there are no such calls
in the source code, we've now seen three different scenarios where build
toolchains silently insert such calls: gcc does it for profiling, some
platforms implement assert() using it, and icc does so for no visible reason.
Checking for accidental use of exit() seems considerably more important than
checking for abort(), so we'll settle for doing that for now. Also, filter
out `__cxa_atexit()` to avoid a false match. It seems that OpenBSD inserts a
call to that despite the fact that libpq contains no C++ code. Discussion:
[https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us](https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us)
[https://git.postgresql.org/pg/commitdiff/e45b0dfa1f1028948decad3abd3b0f6e913a44b0](https://git.postgresql.org/pg/commitdiff/e45b0dfa1f1028948decad3abd3b0f6e913a44b0)

- Improve build-time check that libpq doesn't call exit(). Further fixes for
commit dc227eb82. Per suggestion from Peter Eisentraut, use a stamp-file to
control when the check is run, avoiding repeated executions during "make all".
Also, remove "-g" switch for nm: it's useless and some versions of nm consider
it to conflict with "-u". (Thanks to Noah Misch for running down that
portability issue.) Discussion:
[https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us](https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us)
[https://git.postgresql.org/pg/commitdiff/2f7bae2f924d8213a76370f825dc15eb0aa79796](https://git.postgresql.org/pg/commitdiff/2f7bae2f924d8213a76370f825dc15eb0aa79796)

- Add --clobber-cache option to initdb, for CCA testing. Commit 4656e3d66
replaced the "#define CLOBBER_CACHE_ALWAYS" testing mechanism with a GUC,
which has been a great help for doing cache-clobber testing in more efficient
ways; but there is a gap in the implementation. The only way to do
cache-clobber testing during an initdb run is to use the old method with
#define, because one can't set the GUC from outside. Improve this by adding a
switch to initdb for the purpose. (Perhaps someday we should let initdb pass
through arbitrary "-c NAME=VALUE" switches. Quoting difficulties dissuaded me
from attempting that right now, though.) Back-patch to v14 where 4656e3d66
came in. Discussion:
[https://postgr.es/m/1582507.1624227029@sss.pgh.pa.us](https://postgr.es/m/1582507.1624227029@sss.pgh.pa.us)
[https://git.postgresql.org/pg/commitdiff/b741f4c3ee67666aa333dbb25bd71906b3474def](https://git.postgresql.org/pg/commitdiff/b741f4c3ee67666aa333dbb25bd71906b3474def)

- Don't try to print data type names in slot_store_error_callback(). The
existing code tried to do syscache lookups in an already-failed transaction,
which is problematic to say the least. After some consideration of
alternatives, the best fix seems to be to just drop type names from the error
message altogether. The table and column names seem like sufficient
localization. If the user is unsure what types are involved, she can check
the local and remote table definitions. Having done that, we can also discard
the LogicalRepTypMap hash table, which had no other use. Arguably,
LOGICAL_REP_MSG_TYPE replication messages are now obsolete as well; but we
should probably keep them in case some other use emerges. (The complexity of
removing something from the replication protocol would likely outweigh any
savings anyhow.) Masahiko Sawada and Bharath Rupireddy, per complaint from
Andres Freund. Back-patch to v10 where this code originated. Discussion:
[https://postgr.es/m/20210106020229.ne5xnuu6wlondjpe@alap3.anarazel.de](https://postgr.es/m/20210106020229.ne5xnuu6wlondjpe@alap3.anarazel.de)
[https://git.postgresql.org/pg/commitdiff/50371df266d4c8f4faaf448cbd789d9697443952](https://git.postgresql.org/pg/commitdiff/50371df266d4c8f4faaf448cbd789d9697443952)

- Further restrict the scope of no-exit()-in-libpq test. Disable this check
altogether in --enable-coverage builds, because newer versions of gcc insert
exit() as well as abort() calls for that. Also disable it on AIX and Solaris,
because those platforms tend to provide facilities such as libldap as static
libraries, which then get included in libpq's shlib. We can't expect such
libraries to honor our coding rules. (That platform list might need additional
tweaking, but I think this is enough to keep the buildfarm happy.) Per
reports from Jacob Champion and Noah Misch. Discussion:
[https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us](https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us)
[https://git.postgresql.org/pg/commitdiff/792259591c0fc19c42247fc7668b1064d1e850d4](https://git.postgresql.org/pg/commitdiff/792259591c0fc19c42247fc7668b1064d1e850d4)

Noah Misch pushed:

- Remove XLogFileInit() ability to skip ControlFileLock. Cold paths, initdb and
end-of-recovery, used it. Don't optimize them. Discussion:
[https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com](https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com)
[https://git.postgresql.org/pg/commitdiff/c53c6b98d38a4d238b2fe2ddcea63c33b0a61376](https://git.postgresql.org/pg/commitdiff/c53c6b98d38a4d238b2fe2ddcea63c33b0a61376)

- In XLogFileInit(), fix `*use_existent` postcondition to suit callers.
Infrequently, the mismatch caused log_checkpoints messages and
TRACE_POSTGRESQL_CHECKPOINT_DONE() to witness an "added" count too high by
one. Since that consequence is so minor, no back-patch. Discussion:
[https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com](https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com)
[https://git.postgresql.org/pg/commitdiff/85656bc3050f0846f53de95768b0f9f9df410560](https://git.postgresql.org/pg/commitdiff/85656bc3050f0846f53de95768b0f9f9df410560)

- Dump public schema ownership and security labels. As a side effect, this
corrects dumps of public schema ACLs in databases where the DBA dropped and
recreated that schema. Reviewed by Asif Rehman. Discussion:
[https://postgr.es/m/20201229134924.GA1431748@rfd.leadboat.com](https://postgr.es/m/20201229134924.GA1431748@rfd.leadboat.com)
[https://git.postgresql.org/pg/commitdiff/a7a7be1f2fa6b9f0f48e69f12256d8f588af729b](https://git.postgresql.org/pg/commitdiff/a7a7be1f2fa6b9f0f48e69f12256d8f588af729b)

- Dump COMMENT ON SCHEMA public. As we do for other attributes of the public
schema, omit the COMMENT command when its payload would match what initdb had
installed. For dumps that do carry this new COMMENT command, non-superusers
restoring them are likely to get an error. Reviewed by Asif Rehman.
Discussion:
[https://postgr.es/m/ab48a34c-60f6-e388-502a-3e5fe46a2dae@postgresfriends.org](https://postgr.es/m/ab48a34c-60f6-e388-502a-3e5fe46a2dae@postgresfriends.org)
[https://git.postgresql.org/pg/commitdiff/7ac10f692054e2690aa6f80efdd98bd283c94b10](https://git.postgresql.org/pg/commitdiff/7ac10f692054e2690aa6f80efdd98bd283c94b10)

- Don't ERROR on PreallocXlogFiles() race condition. Before a restartpoint
finishes PreallocXlogFiles(), a startup process KeepFileRestoredFromArchive()
call can unlink the preallocated segment. If a CHECKPOINT sql command had
elicited the restartpoint experiencing the race condition, that sql command
failed. Moreover, the restartpoint omitted its log_checkpoints message and
some inessential resource reclamation. Prevent the ERROR by skipping open()
of the segment. Since these consequences are so minor, no back-patch.
Discussion:
[https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com](https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com)
[https://git.postgresql.org/pg/commitdiff/2b3e4672f7602a6bb46a0735a1b41b635508b290](https://git.postgresql.org/pg/commitdiff/2b3e4672f7602a6bb46a0735a1b41b635508b290)

- Skip WAL recycling and preallocation during archive recovery. The previous
commit addressed the chief consequences of a race condition between
InstallXLogFileSegment() and KeepFileRestoredFromArchive(). Fix three lesser
consequences. A spurious durable_rename_excl() LOG message remained possible.
KeepFileRestoredFromArchive() wasted the proceeds of WAL recycling and
preallocation. Finally, XLogFileInitInternal() could return a descriptor for
a file that KeepFileRestoredFromArchive() had already unlinked. That felt
like a recipe for future bugs. Discussion:
[https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com](https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com)
[https://git.postgresql.org/pg/commitdiff/cc2c7d65fc27e877c9f407587b0b92d46cd6dd16](https://git.postgresql.org/pg/commitdiff/cc2c7d65fc27e877c9f407587b0b92d46cd6dd16)

- Remove XLogFileInit() ability to unlink a pre-existing file. Only initdb used
it. initdb refuses to operate on a non-empty directory and generally does not
cope with pre-existing files of other kinds. Hence, use the opportunity to
simplify. Discussion:
[https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com](https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com)
[https://git.postgresql.org/pg/commitdiff/421484f79c0b80209fa766eb00dbc2453a753273](https://git.postgresql.org/pg/commitdiff/421484f79c0b80209fa766eb00dbc2453a753273)

- Remove literal backslash from Perl \Q ... \E. The behavior changed sometime
after Perl 5.8.9, and "man perlre" says it "may lead to confusing results."
Per buildfarm member gaur. This repairs commit
a7a7be1f2fa6b9f0f48e69f12256d8f588af729b. Discussion:
[https://postgr.es/m/20210629053627.GA2061079@rfd.leadboat.com](https://postgr.es/m/20210629053627.GA2061079@rfd.leadboat.com)
[https://git.postgresql.org/pg/commitdiff/48cb244fb9aca1620e35a14617ca5869b3ea065a](https://git.postgresql.org/pg/commitdiff/48cb244fb9aca1620e35a14617ca5869b3ea065a)

Álvaro Herrera pushed:

- Add PQsendFlushRequest to libpq. This new libpq function allows the
application to send an 'H' message, which instructs the server to flush its
outgoing buffer. This hasn't been needed so far because the Sync message
already requests a buffer; and I failed to realize that this was needed in
pipeline mode because PQpipelineSync also causes the buffer to be flushed.
However, sometimes it is useful to request a flush without establishing a
synchronization point. Backpatch to 14, where pipeline mode was introduced in
libpq. Reported-by: Boris Kolpackov <boris(at)codesynthesis(dot)com> Author: Álvaro
Herrera <alvherre(at)alvh(dot)no-ip(dot)org> Discussion:
[https://postgr.es/m/202106252350.t76x73nt643j@alvherre.pgsql](https://postgr.es/m/202106252350.t76x73nt643j@alvherre.pgsql)
[https://git.postgresql.org/pg/commitdiff/a7192326c74da417d024a189da4d33c1bf1b40b6](https://git.postgresql.org/pg/commitdiff/a7192326c74da417d024a189da4d33c1bf1b40b6)

- Fix libpq state machine in pipeline mode. The original coding required that
PQpipelineSync had been called before the first call to PQgetResult, and
failure to do that would result in an unexpected NULL result being returned.
Fix by setting the right state when a query is sent, rather than leaving it
unchanged and having PQpipelineSync apply the necessary state change. A new
test case to verify the behavior is added, which relies on the new
PQsendFlushRequest() function added by commit a7192326c74d. Backpatch to 14,
where pipeline mode was added. Reported-by: Boris Kolpackov
<boris(at)codesynthesis(dot)com> Author: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Discussion:
[https://postgr.es/m/boris.20210616110321@codesynthesis.com](https://postgr.es/m/boris.20210616110321@codesynthesis.com)
[https://git.postgresql.org/pg/commitdiff/b71a9cb31e46b08aeac35a4355936165648b3c49](https://git.postgresql.org/pg/commitdiff/b71a9cb31e46b08aeac35a4355936165648b3c49)

- Don't reset relhasindex for partitioned tables on ANALYZE. Commit 0e69f705cc1a
introduced code to analyze partitioned table; however, that code fails to
preserve pg_class.relhasindex correctly. Fix by observing whether any indexes
exist rather than accidentally falling through to assuming none do. Backpatch
to 14. Author: Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru> Reviewed-by:
Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> Reviewed-by: Zhihong Yu
<zyu(at)yugabyte(dot)com> Discussion:
[https://postgr.es/m/CALNJ-vS1R3Qoe5t4tbzxrkpBtzRbPq1dDcW4RmA_a+oqweF30w@mail.gmail.com](https://postgr.es/m/CALNJ-vS1R3Qoe5t4tbzxrkpBtzRbPq1dDcW4RmA_a+oqweF30w@mail.gmail.com)
[https://git.postgresql.org/pg/commitdiff/d700518d744e53994fdded14b23ebc15b031b0dd](https://git.postgresql.org/pg/commitdiff/d700518d744e53994fdded14b23ebc15b031b0dd)

Alexander Korotkov pushed:

- Fixes for multirange selectivity estimation. * Fix enumeration of the
multirange operators in calc_multirangesel() and calc_multirangesel()
switches. * Add more regression tests for matching to empty
ranges/multiranges. Reported-by: Alexander Lakhin Discussion:
[https://postgr.es/m/c5269c65-f967-77c5-ff7c-15e621c47f6a%40gmail.com](https://postgr.es/m/c5269c65-f967-77c5-ff7c-15e621c47f6a%40gmail.com)
Author: Alexander Korotkov Backpatch-through: 14, where multiranges were
introduced
[https://git.postgresql.org/pg/commitdiff/178ec460db0a0ced46ac5a01a28a704ca6251e53](https://git.postgresql.org/pg/commitdiff/178ec460db0a0ced46ac5a01a28a704ca6251e53)

Fujii Masao pushed:

- doc: Add type information for postgres_fdw parameters. Author: Shinya Kato
Reviewed-by: Fujii Masao Discussion:
[https://postgr.es/m/TYAPR01MB2896DEB25C3B0D57F6139768C40F9@TYAPR01MB2896.jpnprd01.prod.outlook.com](https://postgr.es/m/TYAPR01MB2896DEB25C3B0D57F6139768C40F9@TYAPR01MB2896.jpnprd01.prod.outlook.com)
[https://git.postgresql.org/pg/commitdiff/61d599ede7424d88bbd4006b968bae366b6b9f5d](https://git.postgresql.org/pg/commitdiff/61d599ede7424d88bbd4006b968bae366b6b9f5d)

- doc: Improve descriptions of tup_returned and tup_fetched in pg_stat_database.
Previously the descriptions of tup_returned and tup_fetched columns in
pg_stat_database view were confusing. This commit improves them so that they
represent the following formulas of those columns more accurately. *
pg_stat_database.tup_returned = sum(pg_stat_all_tables.seq_tup_read) +
sum(pg_stat_all_indexes.idx_tup_read) * pg_stat_database.tup_fetched =
sum(pg_stat_all_tables.idx_tup_fetch) In these formulas, note that the
counters for some system catalogs like pg_database shared across all databases
of a cluster are excluded from the calculations of sum. Author: Masahiro
Ikeda Reviewed-by: Fujii Masao Discussion:
[https://postgr.es/m/9eeeccdb-5dd7-90f9-2807-a4b5d2b76ca3@oss.nttdata.com](https://postgr.es/m/9eeeccdb-5dd7-90f9-2807-a4b5d2b76ca3@oss.nttdata.com)
[https://git.postgresql.org/pg/commitdiff/3465c8a8692fb628bc2710fbeedb9aeb534b0400](https://git.postgresql.org/pg/commitdiff/3465c8a8692fb628bc2710fbeedb9aeb534b0400)

David Rowley pushed:

- Improve various places that double the size of a buffer. Several places were
performing a tight loop to determine the first power of 2 number that's > or
>= the required memory. Instead of using a loop for that, we can use
pg_nextpower2_32 or pg_nextpower2_64. When we need a power of 2 number equal
to or greater than a given amount, we just pass the amount to the nextpower2
function. When we need a power of 2 greater than the amount, we just pass the
amount + 1. Additionally, in tsearch there were a couple of locations that
were performing a while loop when a simple "if" would have done. In both of
these locations only 1 item is being added, so the loop could only have ever
iterated once. Changing the loop into an if statement makes the code very
slightly more optimal as the condition is checked once rather than twice.
There are quite a few remaining locations that increase the size of the buffer
in the following form: while (reqsize >= buflen) { buflen `*=` 2;
buf = repalloc(buf, buflen); } These are not touched in this commit.
repalloc will error out for sizes larger than MaxAllocSize. Changing these to
use pg_nextpower2_32 would remove the chance of that error being raised. It's
unclear from the code if the sizes could ever become that large, so err on the
side of caution. Discussion:
[https://postgr.es/m/CAApHDvp=tns7RL4PH0ZR0M+M-YFLquK7218x=0B_zO+DbOma+w@mail.gmail.com](https://postgr.es/m/CAApHDvp=tns7RL4PH0ZR0M+M-YFLquK7218x=0B_zO+DbOma+w@mail.gmail.com)
Reviewed-by: Zhihong Yu
[https://git.postgresql.org/pg/commitdiff/3788c66788e9f8c6904c6fe903724c1f44812c4d](https://git.postgresql.org/pg/commitdiff/3788c66788e9f8c6904c6fe903724c1f44812c4d)

- Cleanup some aggregate code in the executor. Here we alter the code that calls
build_pertrans_for_aggref() so that the function no longer needs to
special-case whether it's dealing with an aggtransfn or an aggcombinefn. This
allows us to reuse the build_aggregate_transfn_expr() function and just get
rid of the build_aggregate_combinefn_expr() completely. All of the special
case code that was in build_pertrans_for_aggref() has been moved up to the
calling functions. This saves about a dozen lines of code in nodeAgg.c and a
few dozen more in parse_agg.c Also, rename a few variables in nodeAgg.c to
try to make it more clear that we're working with either a aggtransfn or an
aggcombinefn. Some of the old names would have you believe that we were
always working with an aggtransfn. Discussion:
[https://postgr.es/m/CAApHDvptMQ9FmF0D67zC_w88yVnoNVR2+kkOQGUrCmdxWxLULQ@mail.gmail.com](https://postgr.es/m/CAApHDvptMQ9FmF0D67zC_w88yVnoNVR2+kkOQGUrCmdxWxLULQ@mail.gmail.com)
[https://git.postgresql.org/pg/commitdiff/63b1af94375cc2be06a5d6a932db24cd8e9f45e9](https://git.postgresql.org/pg/commitdiff/63b1af94375cc2be06a5d6a932db24cd8e9f45e9)

- Doc: mention that VACUUM can't utilize over 1GB of RAM. Document that setting
maintenance_work_mem to values over 1GB has no effect on VACUUM. Reported-by:
Martín Marqués Author: Laurenz Albe Discussion:
[https://postgr.es/m/CABeG9LsZ2ozUMcqtqWu_-GiFKB17ih3p8wBHXcpfnHqhCnsc7A%40mail.gmail.com](https://postgr.es/m/CABeG9LsZ2ozUMcqtqWu_-GiFKB17ih3p8wBHXcpfnHqhCnsc7A%40mail.gmail.com)
Backpatch-through: 9.6, oldest supported release
[https://git.postgresql.org/pg/commitdiff/ec34040af104a1d25233eccd5715863ace6cbb10](https://git.postgresql.org/pg/commitdiff/ec34040af104a1d25233eccd5715863ace6cbb10)

Heikki Linnakangas pushed:

- Allow specifying pg_waldump --rmgr option multiple times. Before, if you
specified multiple --rmgr options, only the last one took effect. It seems
more sensible to select all the specified resource managers. Reviewed-By:
Daniel Gustafsson, Julien Rouhaud Discussion:
[https://www.postgresql.org/message-id/98344bc2-e222-02ad-a75b-81ffc614c155%40iki.fi](https://www.postgresql.org/message-id/98344bc2-e222-02ad-a75b-81ffc614c155%40iki.fi)
[https://git.postgresql.org/pg/commitdiff/c8bf5098cbc4f32ca724d830d45d5ceb2ad7f96d](https://git.postgresql.org/pg/commitdiff/c8bf5098cbc4f32ca724d830d45d5ceb2ad7f96d)

Bruce Momjian pushed:

- docs: clarify new aggressive vacuum mode for multi-xacts. Reported-by:
eric(dot)mutta(at)gmail(dot)com Discussion:
[https://postgr.es/m/162395467510.686.11947486273299446208@wrigleys.postgresql.org](https://postgr.es/m/162395467510.686.11947486273299446208@wrigleys.postgresql.org)
Backpatch-through: 14
[https://git.postgresql.org/pg/commitdiff/c552e171d16e461c7af60cfe1a891c87be9cbbbf](https://git.postgresql.org/pg/commitdiff/c552e171d16e461c7af60cfe1a891c87be9cbbbf)

- doc: adjust "cities" example to be consistent with other SQL. Reported-by:
tom(at)crystae(dot)net Discussion:
[https://postgr.es/m/162345756191.14472.9754568432103008703@wrigleys.postgresql.org](https://postgr.es/m/162345756191.14472.9754568432103008703@wrigleys.postgresql.org)
Backpatch-through: 9.6
[https://git.postgresql.org/pg/commitdiff/d390bb62a6332f8a913c2c2021d56d6dba5a1dce](https://git.postgresql.org/pg/commitdiff/d390bb62a6332f8a913c2c2021d56d6dba5a1dce)

# Pending Patches

Anna Akenteva sent in another revision of a patch to write the visibility map
during CLUSTER/VACUUM FULL.

Julien Rouhaud sent in another revision of a patch to Expose get_query_def().

Arne Roland sent in another revision of a patch to rename triggers of
partitioned tables.

Peter Eisentraut sent in a patch to remove redundant initializations.

Andrew Dunstan sent in a patch to clean up PostgresNode.pm.

Masahiko Sawada sent in a patch to add ALTER SUBSCRIPTION SET SKIP TRANSACTION,
add errcontext to errors of the applying logical replication changes, and add a
pg_stat_logical_replication_error statistics view.

Bharath Rupireddy, Amit Kapila, and Álvaro Herrera traded patches to refactor
function parse_subscription_options. Instead of using multiple parameters in
parse_subscription_options function signature, use the struct SubOpts that
encapsulate all the subscription options and their values. It will be useful for
future work where we need to add other options in the subscription. Also, use
bitmaps to pass the supported and retrieve the specified options.

Jeff Davis sent in a patch to add a synchronous_replication_interrupt GUC.

Daniel Gustafsson sent in two revisions of a patch to fix the sscanf limit in
pg_basebackup and pg_dump, and fix bug in TOC file error message printing by
unshadowing a variable name.

Dean Rasheed sent in three revisions of a patch to intended to fix a bug that
manifested as overflows in multiplication of NUMERICs.

Michaël Paquier sent in another revision of a patch to add wal_compression=zstd.

Magnus Hagander sent in two more revisions of a patch to add PROXY protocol
support.

Peter Eisentraut sent in another revision of a patch to psql to get it to
display multiple result sets instead of silently dropping all but the first, and
make it possible to return dynamic result sets from procedures.

Ranier Vilela sent in a patch to prevent choosing an invalid number of
partitions in src/backend/executor/nodeAgg.c.

Aleksey Kondratov sent in a patch to enable providing restore_command as a
command line option to pg_rewind.

David Christensen sent in a patch to expand the possible units for size, and
refactor pg_size_pretty and pg_size_bytes to allow for supported unit expansion.

Andrey V. Lepikhov sent in a patch to add an '--ignore-errors' option to
pg_regress.

Jacob Champion sent in another revision of a patch to rework the sslfiles
Makefile target.

Josef Šimánek sent in two revisions of a patch to prevent BRIN index updates
from blocking HOT updates.

Michaël Paquier sent in another revision of a patch to speed up pg_checksums in
cases where the checksum is already set.

Anastasia Lubennikova and Yura Sokolov traded patches to make the smgr API
extensible via new hooks smgr_hook, smgr_init_hook, and smgr_shutdown_hook.

John Naylor and Heikki Linnakangas traded patches to rewrite pg_utf8_verifystr()
for speed.

Dean Rasheed sent in a patch to make numeric x^y work for negative x.

Georgios Kokolatos sent in a patch to teach pg_receivewal to use lz4
compression.

Dean Rasheed sent in two revisions of a patch to relax the constraints on
numeric scale to allow, for example, NUMERIC(3,-3), which rounds values to the
nearest thousand and hold values up to 999000, or NUMERIC(3,6) which could hold
"micro" quantities up to 0.000999.

Thomas Munro and John Naylor traded patches to accelerate tuple sorting for
common types.

Masahiko Sawada sent in another revision of a patch to make it possible to have
transactions involving multiple postgres foreign servers.

Andrey V. Lepikhov sent in a patch to choose async append subplans at the
initial execution stage.

Takashi Menjo sent in another revision of a patch to map WAL segment files on
PMEM as WAL buffers.

Yugo Nagata sent in two more revisions of a patch to fix conn_duration in
pgbench.

Simon Riggs sent in a patch to enhance getRecordTimestamp() in PITR to include
all record types that contain times, add handling for checkpoints, end of
recovery and prepared xact record types, and allow the option of
recovery_target_use_origin_time = off (default) | on.

Vigneshwaran C sent in another revision of a patch to ensure that error message
include hint messages for redundant options error.

Vigneshwaran C sent in another revision of a patch to identify missing
publications from publishers during CREATE/ALTER SUBSCRIPTION.

Álvaro Herrera sent in a patch to clarify error messages when Perl's system()
fails.

Antonin Houska sent in another revision of a patch to clean up up orphaned files
using undo logs.

Jacob Champion sent in another revision of a patch to pull the general SASL
framework out of the SCRAM code.

David Rowley sent in a patch to record a Bitmapset of non-pruned partitions.

Fabien COELHO sent in three more revisions of a patch to fix a bug in pgbench
logging which was caused by some recent changes to time logic.

David Christensen and Fabien COELHO traded patches to add a multiconnect option
to pgbench.

Bharath Rupireddy sent in two more revisions of a patch to tighten up
batch_size, fetch_size options against non-numeric values in the postgres_fdw.

Rahila Syed sent in a patch to add column filtering to logical replication.

Mark Dilger sent in two more revisions of a patch to add a default roles for
each of managing logical replication, host security operations, network security
operations, and database operations, and Allow SET and ALTER SYSTEM SET by
non-superusers.

Yugo Nagata sent in another revision of a patch intended to fix a bug that
manifested as pgbench serialization and deadlock errors.

Amit Langote sent in a patch to explicitly track RT indexes of relations to
check permissions.

Richard Guo sent in two more revisions of a patch to use each rel as both outer
and inner for anti joins.

Vigneshwaran C sent in another revision of a patch to add schema level support
for PUBLICATIONs.

Paul A Jungwirth sent in three more revisions of a patch to implement SQL
standard application time.

Gurjeet Singh sent in a patch to add automatic notification of top transaction
IDs.

David Rowley sent in a patch to allow some window functions to finish execution
early.

Greg Smith sent in a patch to improve some pgbench workloads in the arenas of
INSERT workload, FK indexes, and filler.

Euler Taveira de Oliveira sent in another revision of a patch to add
SSL/TLS-related acronyms MITM and SNI, and change usages of SSL to the more
modern and general SSL/TLS.

Kyotaro HORIGUCHI sent in two revisions of a patch to fix a bug that manifested
as ECPG pre-compiling CREATE AS EXECUTE to an un-compilable C statement by
avoiding touching the parse tree structure and use ExecuteStmt.type to notify
whether the returned string is a statment name or a full statement.

Euler Taveira de Oliveira and Peter Smith traded patches to implement row
filtering for logical replication.

Ranier Vilela sent in a patch to fix an uninitialized variable access in
src/backend/utils/mmgr/freepage.c.

Fabien COELHO sent in five more revisions of a patch to replace rand48 with a
better PRNG.

Haotian Wu sent in another revision of a patch to add a --drop-cascade option
pg_dump/restore.

Pavel Stěhule sent in another revision of a patch to implement schema variables.

Hayato Kuroda sent in another revision of a patch to fix bugs in ECPG's DECLARE
STATEMENT, DEALLOCATE, and DESCRIBE.

Justin Pryzby sent in another revision of a patch to make `pg_ls_*` show
directories and shared filesets.

Fabien COELHO sent in another revision of a patch to factor out psql's echo
code.

Vigneshwaran C sent in a patch ensure that logical replication relations get the
needed cache invalidation when there is a change in schema by adding a callback
for schema changes.

Tom Lane sent in two more revisions of a patch to avoid catalogue accesses in
conversion_error_calls.

Tom Lane sent in another revision of a patch to remove the 64k rangetable limit.

Andy Fan sent in a patch to add not null attrs for RelOptInfo.

Peter Eisentraut sent in a patch to use EVP_EncryptFinal_ex() and
EVP_DecryptFinal_ex() for compatibility with OpenSSL 3.0.

Gilles Darold sent in another revision of a patch to add hooks at the
XactCommand level.

Zhihong Yu sent in a patch to remove a redundant check for transaction in
progress in check_safe_enum_use.

Tatsuo Ishii sent in another revision of a patch to use COPY FREEZE in pgbench.

David Rowley sent in a patch to better document the locking behavior when
attaching and removing partitions.

Browse pgsql-announce by date

  From Date Subject
Next Message Gilles Darold via PostgreSQL Announce 2021-07-05 09:35:53 Ora2Pg v22.0 and 22.1 released
Previous Message PWN via PostgreSQL Announce 2021-06-28 11:45:22 PostgreSQL Weekly News - June 27, 2021