pgsql: pg_stat_statements: Add local_blk_{read|write}_time

2023-10-18 Thread Michael Paquier
pg_stat_statements: Add local_blk_{read|write}_time This commit adds to pg_stat_statements the two new fields for local buffers introduced by 295c36c0c1fa, adding the time spent to read and write these blocks. These are similar to what is done for temp and shared blocks. This information availab

pgsql: Add local_blk_{read|write}_time I/O timing statistics for local

2023-10-18 Thread Michael Paquier
Add local_blk_{read|write}_time I/O timing statistics for local blocks There was no I/O timing statistics for counting read and write timings on local blocks, contrary to the counterparts for temp and shared blocks. This information is available when track_io_timing is enabled. The output of EXP

pgsql: Rename I/O timing statistics columns to shared_blk_{read|write}_

2023-10-18 Thread Michael Paquier
Rename I/O timing statistics columns to shared_blk_{read|write}_time These two counters, defined in BufferUsage to track respectively the time spent while reading and writing blocks have historically only tracked data related to shared buffers, when track_io_timing is enabled. An upcoming patch t

pgsql: Improve pglz_decompress's defenses against corrupt compressed da

2023-10-18 Thread Tom Lane
Improve pglz_decompress's defenses against corrupt compressed data. When processing a match tag, check to see if the claimed "off" is more than the distance back to the output buffer start. If it is, then the data is corrupt, and what's more we would fetch from outside the buffer boundaries and po

pgsql: Improve pglz_decompress's defenses against corrupt compressed da

2023-10-18 Thread Tom Lane
Improve pglz_decompress's defenses against corrupt compressed data. When processing a match tag, check to see if the claimed "off" is more than the distance back to the output buffer start. If it is, then the data is corrupt, and what's more we would fetch from outside the buffer boundaries and po

pgsql: Improve pglz_decompress's defenses against corrupt compressed da

2023-10-18 Thread Tom Lane
Improve pglz_decompress's defenses against corrupt compressed data. When processing a match tag, check to see if the claimed "off" is more than the distance back to the output buffer start. If it is, then the data is corrupt, and what's more we would fetch from outside the buffer boundaries and po

pgsql: Improve pglz_decompress's defenses against corrupt compressed da

2023-10-18 Thread Tom Lane
Improve pglz_decompress's defenses against corrupt compressed data. When processing a match tag, check to see if the claimed "off" is more than the distance back to the output buffer start. If it is, then the data is corrupt, and what's more we would fetch from outside the buffer boundaries and po

pgsql: Improve pglz_decompress's defenses against corrupt compressed da

2023-10-18 Thread Tom Lane
Improve pglz_decompress's defenses against corrupt compressed data. When processing a match tag, check to see if the claimed "off" is more than the distance back to the output buffer start. If it is, then the data is corrupt, and what's more we would fetch from outside the buffer boundaries and po

pgsql: Install wait_event_types.h in VPATH builds

2023-10-18 Thread Michael Paquier
Install wait_event_types.h in VPATH builds An extra rule is needed in src/include/Makefile for VPATH builds to install any generated server-side include files, and wait_event_types.h was forgotten from the set. Issue introduced by fa88928470b5. Reported-by: Christoph Berg Discussion: https://pos

pgsql: doc: PG 16 relnotes: fix spelling error

2023-10-18 Thread Bruce Momjian
doc: PG 16 relnotes: fix spelling error Reported-by: Lele Gaifax Discussion: https://postgr.es/m/87cyximsps@metapensiero.it Backpatch-through: 16 only Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/418d6b4430a5dbfbe4dd9c10ada367f0aee88b52 Modified F

pgsql: jit: Changes for LLVM 17.

2023-10-18 Thread Thomas Munro
jit: Changes for LLVM 17. Changes required by https://llvm.org/docs/NewPassManager.html. Back-patch to 12, leaving the final release of 11 unchanged, consistent with earlier decision not to back-patch LLVM 16 support either. Author: Dmitry Dolgov <9erthali...@gmail.com> Reviewed-by: Andres Freun

pgsql: jit: Changes for LLVM 17.

2023-10-18 Thread Thomas Munro
jit: Changes for LLVM 17. Changes required by https://llvm.org/docs/NewPassManager.html. Back-patch to 12, leaving the final release of 11 unchanged, consistent with earlier decision not to back-patch LLVM 16 support either. Author: Dmitry Dolgov <9erthali...@gmail.com> Reviewed-by: Andres Freun

pgsql: jit: Changes for LLVM 17.

2023-10-18 Thread Thomas Munro
jit: Changes for LLVM 17. Changes required by https://llvm.org/docs/NewPassManager.html. Back-patch to 12, leaving the final release of 11 unchanged, consistent with earlier decision not to back-patch LLVM 16 support either. Author: Dmitry Dolgov <9erthali...@gmail.com> Reviewed-by: Andres Freun

pgsql: jit: Changes for LLVM 17.

2023-10-18 Thread Thomas Munro
jit: Changes for LLVM 17. Changes required by https://llvm.org/docs/NewPassManager.html. Back-patch to 12, leaving the final release of 11 unchanged, consistent with earlier decision not to back-patch LLVM 16 support either. Author: Dmitry Dolgov <9erthali...@gmail.com> Reviewed-by: Andres Freun

pgsql: jit: Changes for LLVM 17.

2023-10-18 Thread Thomas Munro
jit: Changes for LLVM 17. Changes required by https://llvm.org/docs/NewPassManager.html. Back-patch to 12, leaving the final release of 11 unchanged, consistent with earlier decision not to back-patch LLVM 16 support either. Author: Dmitry Dolgov <9erthali...@gmail.com> Reviewed-by: Andres Freun

pgsql: jit: Changes for LLVM 17.

2023-10-18 Thread Thomas Munro
jit: Changes for LLVM 17. Changes required by https://llvm.org/docs/NewPassManager.html. Back-patch to 12, leaving the final release of 11 unchanged, consistent with earlier decision not to back-patch LLVM 16 support either. Author: Dmitry Dolgov <9erthali...@gmail.com> Reviewed-by: Andres Freun

pgsql: jit: Supply LLVMGlobalGetValueType() for LLVM < 8.

2023-10-18 Thread Thomas Munro
jit: Supply LLVMGlobalGetValueType() for LLVM < 8. Commit 37d5babb used this C API function while adding support for LLVM 16 and opaque pointers, but it's not available in LLVM 7 and older. Provide it in our own llvmjit_wrap.cpp. It just calls a C++ function that pre-dates LLVM 3.9, our minimum t

pgsql: jit: Supply LLVMGlobalGetValueType() for LLVM < 8.

2023-10-18 Thread Thomas Munro
jit: Supply LLVMGlobalGetValueType() for LLVM < 8. Commit 37d5babb used this C API function while adding support for LLVM 16 and opaque pointers, but it's not available in LLVM 7 and older. Provide it in our own llvmjit_wrap.cpp. It just calls a C++ function that pre-dates LLVM 3.9, our minimum t

pgsql: jit: Supply LLVMGlobalGetValueType() for LLVM < 8.

2023-10-18 Thread Thomas Munro
jit: Supply LLVMGlobalGetValueType() for LLVM < 8. Commit 37d5babb used this C API function while adding support for LLVM 16 and opaque pointers, but it's not available in LLVM 7 and older. Provide it in our own llvmjit_wrap.cpp. It just calls a C++ function that pre-dates LLVM 3.9, our minimum t

pgsql: jit: Supply LLVMGlobalGetValueType() for LLVM < 8.

2023-10-18 Thread Thomas Munro
jit: Supply LLVMGlobalGetValueType() for LLVM < 8. Commit 37d5babb used this C API function while adding support for LLVM 16 and opaque pointers, but it's not available in LLVM 7 and older. Provide it in our own llvmjit_wrap.cpp. It just calls a C++ function that pre-dates LLVM 3.9, our minimum t

pgsql: jit: Supply LLVMGlobalGetValueType() for LLVM < 8.

2023-10-18 Thread Thomas Munro
jit: Supply LLVMGlobalGetValueType() for LLVM < 8. Commit 37d5babb used this C API function while adding support for LLVM 16 and opaque pointers, but it's not available in LLVM 7 and older. Provide it in our own llvmjit_wrap.cpp. It just calls a C++ function that pre-dates LLVM 3.9, our minimum t

pgsql: jit: Supply LLVMGlobalGetValueType() for LLVM < 8.

2023-10-18 Thread Thomas Munro
jit: Supply LLVMGlobalGetValueType() for LLVM < 8. Commit 37d5babb used this C API function while adding support for LLVM 16 and opaque pointers, but it's not available in LLVM 7 and older. Provide it in our own llvmjit_wrap.cpp. It just calls a C++ function that pre-dates LLVM 3.9, our minimum t

pgsql: jit: Support opaque pointers in LLVM 16.

2023-10-18 Thread Thomas Munro
jit: Support opaque pointers in LLVM 16. Remove use of LLVMGetElementType() and provide the type of all pointers to LLVMBuildXXX() functions when emitting IR, as required by modern LLVM versions[1]. * For LLVM <= 14, we'll still use the old LLVMBuildXXX() functions. * For LLVM == 15, we'll cont

pgsql: jit: Support opaque pointers in LLVM 16.

2023-10-18 Thread Thomas Munro
jit: Support opaque pointers in LLVM 16. Remove use of LLVMGetElementType() and provide the type of all pointers to LLVMBuildXXX() functions when emitting IR, as required by modern LLVM versions[1]. * For LLVM <= 14, we'll still use the old LLVMBuildXXX() functions. * For LLVM == 15, we'll cont

pgsql: jit: Support opaque pointers in LLVM 16.

2023-10-18 Thread Thomas Munro
jit: Support opaque pointers in LLVM 16. Remove use of LLVMGetElementType() and provide the type of all pointers to LLVMBuildXXX() functions when emitting IR, as required by modern LLVM versions[1]. * For LLVM <= 14, we'll still use the old LLVMBuildXXX() functions. * For LLVM == 15, we'll cont

pgsql: jit: Support opaque pointers in LLVM 16.

2023-10-18 Thread Thomas Munro
jit: Support opaque pointers in LLVM 16. Remove use of LLVMGetElementType() and provide the type of all pointers to LLVMBuildXXX() functions when emitting IR, as required by modern LLVM versions[1]. * For LLVM <= 14, we'll still use the old LLVMBuildXXX() functions. * For LLVM == 15, we'll cont

pgsql: jit: Support opaque pointers in LLVM 16.

2023-10-18 Thread Thomas Munro
jit: Support opaque pointers in LLVM 16. Remove use of LLVMGetElementType() and provide the type of all pointers to LLVMBuildXXX() functions when emitting IR, as required by modern LLVM versions[1]. * For LLVM <= 14, we'll still use the old LLVMBuildXXX() functions. * For LLVM == 15, we'll cont

pgsql: jit: Support opaque pointers in LLVM 16.

2023-10-18 Thread Thomas Munro
jit: Support opaque pointers in LLVM 16. Remove use of LLVMGetElementType() and provide the type of all pointers to LLVMBuildXXX() functions when emitting IR, as required by modern LLVM versions[1]. * For LLVM <= 14, we'll still use the old LLVMBuildXXX() functions. * For LLVM == 15, we'll cont

pgsql: pg_upgrade: Fix test name in 002_pg_upgrade.pl

2023-10-18 Thread Michael Paquier
pg_upgrade: Fix test name in 002_pg_upgrade.pl Author: Hou Zhijie Discussion: https://postgr.es/m/tyapr01mb5724a40d47e71f4717357ec694...@tyapr01mb5724.jpnprd01.prod.outlook.com Backpatch-through: 15 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3f9b1f26ca0eee46af

pgsql: pg_upgrade: Fix test name in 002_pg_upgrade.pl

2023-10-18 Thread Michael Paquier
pg_upgrade: Fix test name in 002_pg_upgrade.pl Author: Hou Zhijie Discussion: https://postgr.es/m/tyapr01mb5724a40d47e71f4717357ec694...@tyapr01mb5724.jpnprd01.prod.outlook.com Backpatch-through: 15 Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c4e561c1e02

pgsql: pg_upgrade: Fix test name in 002_pg_upgrade.pl

2023-10-18 Thread Michael Paquier
pg_upgrade: Fix test name in 002_pg_upgrade.pl Author: Hou Zhijie Discussion: https://postgr.es/m/tyapr01mb5724a40d47e71f4717357ec694...@tyapr01mb5724.jpnprd01.prod.outlook.com Backpatch-through: 15 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/4277bcb3012