pgsql: Introduce helper SIMD functions for small byte arrays

2024-03-05 Thread John Naylor
Introduce helper SIMD functions for small byte arrays

vector8_min - helper for emulating ">=" semantics

vector8_highbit_mask - used to turn the result of a vector
comparison into a bitmask

Masahiko Sawada

Reviewed by Nathan Bossart, with additional adjustments by me
Discussion: 
https://postgr.es/m/CAFBsxsHbBm_M22gLBO%2BAZT4mfMq3L_oX3wdKZxjeNnT7fHsYMQ%40mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/9f225e992bedd7615b48418bd53d21b6b003dd3f

Modified Files
--
src/include/port/simd.h | 47 +++
1 file changed, 47 insertions(+)



pgsql: Move some bitmap logic out of bitmapset.c

2024-03-05 Thread John Naylor
Move some bitmap logic out of bitmapset.c

Move the logic for selecting appropriate pg_bitutils.h
functions based on word size to bitmapset.h for wider
visibility.

Reviewed (in a previous version) by Tom Lane
Discussion: 
https://postgr.es/m/CAFBsxsFW2JjTo58jtDB%2B3sZhxMx3t-3evew8%3DAcr%2BGGhC%2BkFaA%40mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/3e76a806cbb0f8a6cf3ba7a3b371643fa1e0fe96

Modified Files
--
src/backend/nodes/bitmapset.c | 13 -
src/include/nodes/bitmapset.h | 13 +
2 files changed, 13 insertions(+), 13 deletions(-)



pgsql: Doc: Improve replication slot synchronization section.

2024-03-05 Thread Amit Kapila
Doc: Improve replication slot synchronization section.

Author: Peter Smith
Reviewed-by: Michael Paquier, Laurenz Albe
Discussion: 
https://postgr.es/m/cahut+ps01fv9bjhj6njcfihu0w0gu1jcu0tko0rymhhx-hz...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/60c07820d62231d9110119b92cc1136df6dd4fb7

Modified Files
--
doc/src/sgml/logicaldecoding.sgml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgsql: Add recovery TAP test for race condition with slot invalidations

2024-03-05 Thread Michael Paquier
Add recovery TAP test for race condition with slot invalidations

This commit adds a recovery test to provide coverage for the bug fixed
in 818fefd8fd, using an injection point to wait just after the process
of an active slot is killed.  The trick is to give enough time for
effective_xmin and effective_catalog_xmin to advance so as the slot
invalidation robustness can be checked since the active process is
killed without holding its slot's mutex for a short time.

Author: Bertrand Drouvot
Discussion: 
https://postgr.es/m/zdyzya4yrnapw...@ip-10-97-1-34.eu-west-3.compute.internal

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/08a52ab151ca599406883768cdc08b7929e516de

Modified Files
--
src/backend/replication/slot.c |   9 ++
.../recovery/t/035_standby_logical_decoding.pl | 116 -
2 files changed, 123 insertions(+), 2 deletions(-)



pgsql: Add --copy-file-range option to pg_upgrade.

2024-03-05 Thread Thomas Munro
Add --copy-file-range option to pg_upgrade.

The copy_file_range() system call is available on at least Linux and
FreeBSD, and asks the kernel to use efficient ways to copy ranges of a
file.  Options available to the kernel include sharing block ranges
(similar to --clone mode), and pushing down block copies to the storage
layer.

For automated testing, see PG_TEST_PG_UPGRADE_MODE.  (Perhaps in a later
commit we could consider setting this mode for one of the CI targets.)

Reviewed-by: Peter Eisentraut 
Discussion: 
https://postgr.es/m/CA%2BhUKGKe7Hb0-UNih8VD5UNZy5-ojxFb3Pr3xSBBL8qj2M2%3DdQ%40mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/d93627bcbe5001750e7611f0e637200e2d81dcff

Modified Files
--
configure  |  2 +-
configure.ac   |  1 +
doc/src/sgml/ref/pgupgrade.sgml| 13 +++
meson.build|  1 +
src/bin/pg_upgrade/TESTING |  4 +-
src/bin/pg_upgrade/check.c |  3 ++
src/bin/pg_upgrade/file.c  | 78 ++
src/bin/pg_upgrade/option.c|  7 +++-
src/bin/pg_upgrade/pg_upgrade.h|  4 ++
src/bin/pg_upgrade/relfilenumber.c |  8 
src/include/pg_config.h.in |  3 ++
11 files changed, 120 insertions(+), 4 deletions(-)



pgsql: Remove surplus trailing semicolon

2024-03-05 Thread David Rowley
Remove surplus trailing semicolon

Author: Richard Guo
Discussion: 
https://postgr.es/m/CAMbWs4-qjotfa7G=5peow4ldddx58mmtwddpdou3quse_bk...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/2bce0ad67f93af6d1889ec611a8f618245291e3f

Modified Files
--
src/backend/optimizer/plan/planner.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: Add a few recent commits to .git-blame-ignore-revs.

2024-03-05 Thread Nathan Bossart
Add a few recent commits to .git-blame-ignore-revs.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/571530452fe0b15727b8b6730e64800a5e96a7b2

Modified Files
--
.git-blame-ignore-revs | 12 
1 file changed, 12 insertions(+)



pgsql: Run pgindent again on the same file.

2024-03-05 Thread Jeff Davis
Run pgindent again on the same file.

Apparently, pgindent got confused by the double space. The first time
I ran it, it moved the function name to the next line. The second time
I ran it, it moved the function name back, but without the double
space.

Now the results appear stable.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/0984a3b851abe89bec6c3eff51b03038808e1997

Modified Files
--
src/backend/utils/activity/backend_status.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgsql: Run pgindent for commit ef4cfdce0e.

2024-03-05 Thread Jeff Davis
Run pgindent for commit ef4cfdce0e.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/b406af1806e9fc5c090e58282c7d98f22a4b397f

Modified Files
--
src/backend/utils/activity/backend_status.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgsql: docs: Update HOT update docs for 19d8e2308b

2024-03-05 Thread Jeff Davis
docs: Update HOT update docs for 19d8e2308b

Commit 19d8e2308b changed when the HOT update optimization is possible
but neglected to update the Heap-Only Tuples (HOT) documentation.  This
patch updates that documentation accordingly.

Author: Elizabeth Christensen
Backpatch-through: 16
Reviewed-By: Stephen Frost, Alvaro Herrera
Discussion: 
https://postgr.es/m/CABoUFXRjisr58Ct_3VsFEdQx+fJeQTWTdJnM7XAp=8mubto...@mail.gmail.com

Branch
--
REL_16_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/8870c54d8a17da3e2f7597acf2922f0fb8eadfa5

Modified Files
--
doc/src/sgml/storage.sgml | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)



pgsql: docs: Update HOT update docs for 19d8e2308b

2024-03-05 Thread Jeff Davis
docs: Update HOT update docs for 19d8e2308b

Commit 19d8e2308b changed when the HOT update optimization is possible
but neglected to update the Heap-Only Tuples (HOT) documentation.  This
patch updates that documentation accordingly.

Author: Elizabeth Christensen
Backpatch-through: 16
Reviewed-By: Stephen Frost, Alvaro Herrera
Discussion: 
https://postgr.es/m/CABoUFXRjisr58Ct_3VsFEdQx+fJeQTWTdJnM7XAp=8mubto...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/7a9328e8e40534fb4de41b4ac152e3c6989d84e7

Modified Files
--
doc/src/sgml/storage.sgml | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)



pgsql: Update sepgsql expected output.

2024-03-05 Thread Jeff Davis
Update sepgsql expected output.

Fix for buildfarm member rhinoceros after commit 2af07e2f74.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/c7ea3f42291bf5c74be8f957c775c5e7b3f78592

Modified Files
--
contrib/sepgsql/expected/ddl.out | 37 +
1 file changed, 37 insertions(+)



pgsql: Fix references to renamed function in comments

2024-03-05 Thread Heikki Linnakangas
Fix references to renamed function in comments

I renamed the function in commit 024c521117, but missed these
comments.

Reported-by: Richard Guo
Discussion: 
https://www.postgresql.org/message-id/cambws4-jr6qc7jrmkwz-zxqy_ayluz3phjgep4b91of321c...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/ef4cfdce0ef8b926803b0d5ffafef1c42b15bbfb

Modified Files
--
src/backend/utils/activity/backend_status.c | 8 
1 file changed, 4 insertions(+), 4 deletions(-)



pgsql: Improve field order in RangeTblEntry

2024-03-05 Thread Peter Eisentraut
Improve field order in RangeTblEntry

When perminfoindex was added, it was just added at the end of the
block.  It would make sense to keep it closer to more related fields.
In passing, also add an inline comment, like the other fields have.
(Other field reorderings and documentation improvements in
RangeTblEntry are being discussed, but it's better not to mix them
together.)

Discussion: 
https://www.postgresql.org/message-id/flat/6c1fbccc-85c8-40d3-b08b-4f47f2093711%40eisentraut.org

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/e03349144b00b775523f3e0ea8ef56ec2fb44b11

Modified Files
--
src/backend/nodes/outfuncs.c | 2 +-
src/backend/nodes/readfuncs.c| 2 +-
src/include/catalog/catversion.h | 2 +-
src/include/nodes/parsenodes.h   | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)



pgsql: Fix misspelled assertions

2024-03-05 Thread Alvaro Herrera
Fix misspelled assertions

Remove an extra & operator, per Tom Lane.  My bugs, introduced with
commit 53c2a97a9266.

Discussion: https://postgr.es/m/3885480.1709590...@sss.pgh.pa.us

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/0d3a71d0c8a762247cf558cf41847e599a1f5539

Modified Files
--
src/backend/access/transam/slru.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgsql: Rework redundant code in subtrans.c

2024-03-05 Thread Alvaro Herrera
Rework redundant code in subtrans.c

When this code was written the duplicity didn't matter, but with all the
SLRU-bank stuff we just added, it has become excessive.  Turn it into a
simpler loop with no code duplication.  Also add a test so that this
code becomes covered.

Discussion: https://postgr.es/m/202403041517.3a35jw53os65@alvherre.pgsql

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/1a2654b32b546d25e39a0c02410049559a3d4573

Modified Files
--
src/backend/access/transam/subtrans.c | 29 ++--
src/test/recovery/t/009_twophase.pl   | 42 +++
2 files changed, 49 insertions(+), 22 deletions(-)



pgsql: Rename pg_constraint.conwithoutoverlaps to conperiod

2024-03-05 Thread Peter Eisentraut
Rename pg_constraint.conwithoutoverlaps to conperiod

pg_constraint.conwithoutoverlaps was recently added to support primary
keys and unique constraints with the WITHOUT OVERLAPS clause.  An
upcoming patch provides the foreign-key side of this functionality,
but the syntax there is different and uses the keyword PERIOD.  It
would make sense to use the same pg_constraint field for both of
these, but then we should pick a more general name that conveys "this
constraint has a temporal/period-related feature".  conperiod works
for that and is nicely compact.  Changing this now avoids possibly
having to introduce versioning into clients.  Note there are still
some "without overlaps" variables left, which deal specifically with
the parsing of the primary key/unique constraint feature.

Author: Paul A. Jungwirth 
Discussion: 
https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mdhcy4_qq0+noc...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/030e10ff1a365796bd4bcbbc5b6a8552f7efc765

Modified Files
--
doc/src/sgml/catalogs.sgml  |  2 +-
src/backend/catalog/heap.c  |  4 ++--
src/backend/catalog/pg_constraint.c |  4 ++--
src/backend/commands/tablecmds.c|  6 +++---
src/backend/commands/trigger.c  |  2 +-
src/backend/commands/typecmds.c |  2 +-
src/backend/utils/adt/ruleutils.c   |  2 +-
src/backend/utils/cache/relcache.c  |  6 +++---
src/bin/pg_dump/pg_dump.c   | 12 ++--
src/bin/pg_dump/pg_dump.h   |  3 +--
src/bin/psql/describe.c |  4 ++--
src/include/catalog/catversion.h|  2 +-
src/include/catalog/pg_constraint.h |  4 ++--
13 files changed, 26 insertions(+), 27 deletions(-)