pgsql: doc: Use system-username instead of system-user

2024-02-19 Thread Michael Paquier
doc: Use system-username instead of system-user This inconsistency has been introduced in efb6f4a4f9b6. Reported-by: Julien Rouhaud Author: Bertrand Drouvot Discussion: https://postgr.es/m/zdmwux1hpiebk...@ip-10-97-1-34.eu-west-3.compute.internal Backpatch-through: 16 Branch --

pgsql: ecpg: Fix zero-termination of string generated by intoasc()

2024-02-18 Thread Michael Paquier
ecpg: Fix zero-termination of string generated by intoasc() intoasc(), a wrapper for PGTYPESinterval_to_asc that converts an interval to its textual representation, used a plain memcpy() when copying its result. This could miss a zero-termination in the result string, leading to an incorrect

pgsql: ecpg: Fix zero-termination of string generated by intoasc()

2024-02-18 Thread Michael Paquier
ecpg: Fix zero-termination of string generated by intoasc() intoasc(), a wrapper for PGTYPESinterval_to_asc that converts an interval to its textual representation, used a plain memcpy() when copying its result. This could miss a zero-termination in the result string, leading to an incorrect

pgsql: ecpg: Fix zero-termination of string generated by intoasc()

2024-02-18 Thread Michael Paquier
ecpg: Fix zero-termination of string generated by intoasc() intoasc(), a wrapper for PGTYPESinterval_to_asc that converts an interval to its textual representation, used a plain memcpy() when copying its result. This could miss a zero-termination in the result string, leading to an incorrect

pgsql: ecpg: Fix zero-termination of string generated by intoasc()

2024-02-18 Thread Michael Paquier
ecpg: Fix zero-termination of string generated by intoasc() intoasc(), a wrapper for PGTYPESinterval_to_asc that converts an interval to its textual representation, used a plain memcpy() when copying its result. This could miss a zero-termination in the result string, leading to an incorrect

pgsql: ecpg: Fix zero-termination of string generated by intoasc()

2024-02-18 Thread Michael Paquier
ecpg: Fix zero-termination of string generated by intoasc() intoasc(), a wrapper for PGTYPESinterval_to_asc that converts an interval to its textual representation, used a plain memcpy() when copying its result. This could miss a zero-termination in the result string, leading to an incorrect

pgsql: ecpg: Fix zero-termination of string generated by intoasc()

2024-02-18 Thread Michael Paquier
ecpg: Fix zero-termination of string generated by intoasc() intoasc(), a wrapper for PGTYPESinterval_to_asc that converts an interval to its textual representation, used a plain memcpy() when copying its result. This could miss a zero-termination in the result string, leading to an incorrect

pgsql: ecpg: Fix error handling on OOMs when parsing timestamps

2024-02-18 Thread Michael Paquier
ecpg: Fix error handling on OOMs when parsing timestamps pgtypes_alloc() can return NULL when failing an allocation, which is something that PGTYPEStimestamp_defmt_asc() has forgotten about when translating a timestamp for 'D', 'r', 'R' and 'T' as these require a temporary allocation. This is

pgsql: Revert "Refactor CopyReadAttributes{CSV,Text}() to use a callbac

2024-02-13 Thread Michael Paquier
Revert "Refactor CopyReadAttributes{CSV,Text}() to use a callback in COPY FROM" This reverts commit 95fb5b49024, for reasons similar to what led to 1aa8324b81fa. In this case, the callback was called once per row, which is less worse than the previous callback introduced for COPY TO called once

pgsql: pgcrypto: Fix incorrect argument vs PG_GETARG*() mappings

2024-02-13 Thread Michael Paquier
pgcrypto: Fix incorrect argument vs PG_GETARG*() mappings The following functions use a mix of bytea and text arguments, but their C internals always used PG_GETARG_BYTEA_PP(), creating an incorrect mix with the argument types expected by encrypt_internal(): -

pgsql: Improve comment about query_id_enabled in queryjumblefuncs.c

2024-02-13 Thread Michael Paquier
Improve comment about query_id_enabled in queryjumblefuncs.c The comment was inexact because query_id_enabled will not be switched to "true" even if compute_query_id is "on", unless a module requests for it. While on it, this adds a comment to mention that IsQueryIdEnabled() should be used to

pgsql: Add previous commit to .git-blame-ignore-revs

2024-02-08 Thread Michael Paquier
Add previous commit to .git-blame-ignore-revs Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3c44746fdb5d5603f6bc4645c78bca6c702fc920 Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

pgsql: Fix indentation of copyto.c

2024-02-08 Thread Michael Paquier
Fix indentation of copyto.c Issue introduced by b619852086ed. Per buildfarm member koel. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/49e7c6f78ed608c5d5454080ae19c0e7f1b09a04 Modified Files -- src/backend/commands/copyto.c | 4 ++-- 1 file changed,

pgsql: Improve COPY TO performance when server and client encodings mat

2024-02-08 Thread Michael Paquier
ion. Reported-by: Andres Freund Analyzed-by: Andres Freund Author: Michael Paquier Reviewed-by: Heikki Linnakangas Discussion: https://postgr.es/m/20240206020504.edijzczkgd25e...@awork3.anarazel.de Branch -- master Details --- https://git.postgresql.org/pg/commitd

pgsql: Simplify signature of CopyAttributeOutCSV() in copyto.c

2024-02-06 Thread Michael Paquier
Simplify signature of CopyAttributeOutCSV() in copyto.c This has come up in 2889fd23be56, reverted later on, and is still useful on its own to reduce a bit the differences between the code paths dedicated to CSV and text. Discussion: https://postgr.es/m/zcckwaefrloqp...@paquier.xyz Branch

pgsql: Revert "Refactor CopyAttributeOut{CSV,Text}() to use a callback

2024-02-06 Thread Michael Paquier
Revert "Refactor CopyAttributeOut{CSV,Text}() to use a callback in COPY TO" This reverts commit 2889fd23be56, following a discussion with Andres Freund as this callback, being called once per attribute when sending a relation's row, can involve a lot of indirect function calls (more attributes to

pgsql: doc: Spell I/O consistently

2024-02-05 Thread Michael Paquier
doc: Spell I/O consistently The pg_stat_io and pg_stat_copy_progress view docs spelled "I/O" as "IO" or even "io" in some places when not referring to literal names or string values. Author: Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/87fry6lx5s@wibble.ilmari.org Branch --

pgsql: Refactor CopyAttributeOut{CSV,Text}() to use a callback in COPY

2024-02-04 Thread Michael Paquier
Refactor CopyAttributeOut{CSV,Text}() to use a callback in COPY TO These routines are used by the text and CSV formats to send an output representation of a string, applying quotes if required. This is similar to 95fb5b49024a, reducing the number of "if" branches that need to be checked on a

pgsql: Refactor CopyReadAttributes{CSV,Text}() to use a callback in COP

2024-02-04 Thread Michael Paquier
Refactor CopyReadAttributes{CSV,Text}() to use a callback in COPY FROM CopyReadAttributes{CSV,Text}() are used to parse lines for text and CSV format. This reduces the number of "if" branches that need to be checked when parsing fields in CSV and text mode when dealing with a COPY FROM,

pgsql: pg_basebackup: Fix check for MINIMUM_VERSION_FOR_WAL_SUMMARIES

2024-02-03 Thread Michael Paquier
pg_basebackup: Fix check for MINIMUM_VERSION_FOR_WAL_SUMMARIES MINIMUM_VERSION_FOR_WAL_SUMMARIES is used to check if the directory pg_wal/summaries/ should be created in a base backup, but its condition was reversed: pg_wal/summaries/ would be created when taking base backups from backends of v16

pgsql: Fix stats_fetch_consistency with stats for fixed-numbered object

2024-02-01 Thread Michael Paquier
Fix stats_fetch_consistency with stats for fixed-numbered objects This impacts the statistics retrieved in transactions for the following views when updating the value of stats_fetch_consistency, leading to behaviors contrary to what is documented since 605994651b6a as an update of this parameter

pgsql: Fix stats_fetch_consistency with stats for fixed-numbered object

2024-02-01 Thread Michael Paquier
Fix stats_fetch_consistency with stats for fixed-numbered objects This impacts the statistics retrieved in transactions for the following views when updating the value of stats_fetch_consistency, leading to behaviors contrary to what is documented since 605994651b6a as an update of this parameter

pgsql: Fix stats_fetch_consistency with stats for fixed-numbered object

2024-02-01 Thread Michael Paquier
Fix stats_fetch_consistency with stats for fixed-numbered objects This impacts the statistics retrieved in transactions for the following views when updating the value of stats_fetch_consistency, leading to behaviors contrary to what is documented since 605994651b6a as an update of this parameter

pgsql: Add .gitignore to src/test/modules/gin/

2024-01-30 Thread Michael Paquier
Add .gitignore to src/test/modules/gin/ This has been forgotten in 6a1ea02c491d. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0fda3921380798897b6faca5e4fdcdc22f950f12 Modified Files -- src/test/modules/gin/.gitignore | 4 1 file changed, 4

pgsql: Add tests for int4_bool() in int.c

2024-01-30 Thread Michael Paquier
Add tests for int4_bool() in int.c This cast was previously not covered at all by the regression tests. Author: Christoph Berg Discussion: https://postgr.es/m/zyqz1hnfld_4r...@msg.df7cb.de Branch -- master Details ---

pgsql: Fix various issues with ALTER TEXT SEARCH CONFIGURATION

2024-01-30 Thread Michael Paquier
down. Reported-by: Alexander Lakhin Author: Tender Wang, Michael Paquier Discussion: https://postgr.es/m/18310-1eb233c590818...@postgresql.org Backpatch-through: 12 Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0561097822a1462391f4f44665ecf831ce523b6e Mod

pgsql: Fix various issues with ALTER TEXT SEARCH CONFIGURATION

2024-01-30 Thread Michael Paquier
down. Reported-by: Alexander Lakhin Author: Tender Wang, Michael Paquier Discussion: https://postgr.es/m/18310-1eb233c590818...@postgresql.org Backpatch-through: 12 Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/4d0e8a008bdcaf09c89585c59e860cdc0a837a3b Mod

pgsql: Fix various issues with ALTER TEXT SEARCH CONFIGURATION

2024-01-30 Thread Michael Paquier
down. Reported-by: Alexander Lakhin Author: Tender Wang, Michael Paquier Discussion: https://postgr.es/m/18310-1eb233c590818...@postgresql.org Backpatch-through: 12 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/f33e83285a1419bf083ec0a6913268d454ce22e9 Mod

pgsql: Fix various issues with ALTER TEXT SEARCH CONFIGURATION

2024-01-30 Thread Michael Paquier
down. Reported-by: Alexander Lakhin Author: Tender Wang, Michael Paquier Discussion: https://postgr.es/m/18310-1eb233c590818...@postgresql.org Backpatch-through: 12 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3e91dba8b079c02dc5204108c7e797b402c75779 Modified Fi

pgsql: Fix various issues with ALTER TEXT SEARCH CONFIGURATION

2024-01-30 Thread Michael Paquier
down. Reported-by: Alexander Lakhin Author: Tender Wang, Michael Paquier Discussion: https://postgr.es/m/18310-1eb233c590818...@postgresql.org Backpatch-through: 12 Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/dde5b01c33f9a8c41f5598dd5d4db718df171eed Mod

pgsql: Fix various issues with ALTER TEXT SEARCH CONFIGURATION

2024-01-30 Thread Michael Paquier
down. Reported-by: Alexander Lakhin Author: Tender Wang, Michael Paquier Discussion: https://postgr.es/m/18310-1eb233c590818...@postgresql.org Backpatch-through: 12 Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/41fa4b31c12f4affc5d0ed1e257dacaf2bbe0731 Mod

pgsql: Add more LOG messages when starting and ending recovery from a b

2024-01-28 Thread Michael Paquier
for now (older versions have heavily refactored the WAL recovery paths, making the change less straight-forward to do). Author: Andres Freund Reviewed-by: David Steele, Laurenz Albe, Michael Paquier Discussion: https://postgr.es/m/20231117041811.vz4vgkthwjnwp...@awork3.anarazel.de Backpatch-through

pgsql: Add more LOG messages when starting and ending recovery from a b

2024-01-28 Thread Michael Paquier
for now (older versions have heavily refactored the WAL recovery paths, making the change less straight-forward to do). Author: Andres Freund Reviewed-by: David Steele, Laurenz Albe, Michael Paquier Discussion: https://postgr.es/m/20231117041811.vz4vgkthwjnwp...@awork3.anarazel.de Backpatch-through

Re: pgsql: Temporary patch to help debug pg_walsummary test failures.

2024-01-28 Thread Michael Paquier
On Fri, Jan 26, 2024 at 06:37:17PM +, Robert Haas wrote: > Temporary patch to help debug pg_walsummary test failures. > > This patch should be reverted once we sort out what's happening here. Not sure if that's worth fixing if this should be gone at some point, but koel has been complaining

pgsql: Fix DROP ROLE when specifying duplicated roles

2024-01-28 Thread Michael Paquier
Fix DROP ROLE when specifying duplicated roles This commit fixes failures with "tuple already updated by self" when listing twice the same role and in a DROP ROLE query. This is an oversight in 6566133c5f52, that has introduced a two-phase logic in DropRole() where dependencies of all the roles

pgsql: Fix DROP ROLE when specifying duplicated roles

2024-01-28 Thread Michael Paquier
Fix DROP ROLE when specifying duplicated roles This commit fixes failures with "tuple already updated by self" when listing twice the same role and in a DROP ROLE query. This is an oversight in 6566133c5f52, that has introduced a two-phase logic in DropRole() where dependencies of all the roles

pgsql: Reindex toast before its main relation in reindex_relation()

2024-01-26 Thread Michael Paquier
relation. Per request from Richard Vesely. Author: Gurjeet Singh Reviewed-by: Nathan Bossart, Michael Paquier Discussion: https://postgr.es/m/18016-2bd9b549b1fe4...@postgresql.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f2bf8fb04886e3ea82e7f7f86696ac78e06b7e60

pgsql: Fix comment in index.c

2024-01-25 Thread Michael Paquier
Fix comment in index.c Extracted from a larger patch by the same author. Author: Gurjeet Singh Discussion: https://postgr.es/m/CABwTF4WX=m5pQvKXvLFJoEH=hSd6O=iZSqxVqHKjFm+iL-AO=w...@mail.gmail.com Branch -- master Details ---

pgsql: Revert "Add support for parsing of large XML data (>= 10MB)"

2024-01-25 Thread Michael Paquier
Revert "Add support for parsing of large XML data (>= 10MB)" This reverts commit 2197d06224a1, following a discussion over a Coverity report where issues like the "Billion laugh attack" could cause the backend to waste CPU and memory even if a client applied checks on the size of the data given

pgsql: Add more LOG messages when starting and ending recovery from a b

2024-01-25 Thread Michael Paquier
. - Recovery is restarting from a backup start LSN, without a backup_label. - Recovery has completed from a backup. Author: Andres Freund Reviewed-by: David Steele, Laurenz Albe, Michael Paquier Discussion: https://postgr.es/m/20231117041811.vz4vgkthwjnwp...@awork3.anarazel.de Branch -- master

pgsql: pgbench: Add \syncpipeline

2024-01-23 Thread Michael Paquier
pgbench: Add \syncpipeline This change adds a new meta-command called \syncpipeline to pgbench, able to send a sync message without flushing using the new libpq function PQsendPipelineSync(). This meta-command is available within a block made of \startpipeline and \endpipeline. Author: Anthonin

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

2024-01-23 Thread Michael Paquier
Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees This command, when used to add a column on a parent table with a complex inheritance tree, tried to update multiple times the same tuple in pg_attribute for a child table when incrementing attinhcount, causing failures with "tuple

pgsql: Improve stability of recovery test 035_standby_logical_decoding

2024-01-22 Thread Michael Paquier
Reviewed-by: Alexander Lakhin, Michael Paquier Discussion: https://postgr.es/m/oszpr01mb6310ed3cedb531bcedbc6af2fd...@oszpr01mb6310.jpnprd01.prod.outlook.com Discussion: https://postgr.es/m/bf67e076-b163-9ba3-4ade-b9fc51a3a...@gmail.com Backpatch-through: 16 Branch -- REL_16_STABLE Details

pgsql: Improve stability of recovery test 035_standby_logical_decoding

2024-01-22 Thread Michael Paquier
Reviewed-by: Alexander Lakhin, Michael Paquier Discussion: https://postgr.es/m/oszpr01mb6310ed3cedb531bcedbc6af2fd...@oszpr01mb6310.jpnprd01.prod.outlook.com Discussion: https://postgr.es/m/bf67e076-b163-9ba3-4ade-b9fc51a3a...@gmail.com Backpatch-through: 16 Branch -- master Details --- https

pgsql: ci: Enable injection points in builds

2024-01-22 Thread Michael Paquier
ci: Enable injection points in builds --enable-injection-points and -Dinjection_points=true are now given to the commands triggered by the tasks where assertions are enabled, providing coverage for injection points or any test using them. Author: Heikki Linnakangas Discussion:

pgsql: Fix ERROR message in injection_point.c

2024-01-22 Thread Michael Paquier
Fix ERROR message in injection_point.c This commit fixes an error message that failed to show the correct function and library names when a function cannot be loaded. While on it, adjust the call to load_external_function() so as this ERROR can be reached, by making load_external_function()

pgsql: Fix some typos

2024-01-21 Thread Michael Paquier
Fix some typos Author: Yongtao Huang Discussion: https://postgr.es/m/caoe1go1f99o5jsphtxddc5bxm7azetu8q3axlh4aavgku1a...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b199eb89c67d737ced55721590f7fc8ff585e837 Modified Files --

pgsql: Add test module injection_points

2024-01-21 Thread Michael Paquier
Add test module injection_points This provides basic coverage for injection points within a single process, while providing some callbacks that can be used for other tests. There are plans to extend this module later with more advanced capabilities for tests. Author: Michael Paquier

pgsql: Add backend support for injection points

2024-01-21 Thread Michael Paquier
on a best-effort basis. This could be refined further but any tests but what we have here was fine with the tests I've written while implementing these backend APIs. Author: Michael Paquier, with doc suggestions from Ashutosh Bapat. Reviewed-by: Ashutosh Bapat, Nathan Bossart, Álvaro Herrera, Dilip

pgsql: psql: Add ignore_slash_options in bind's inactive branch

2024-01-18 Thread Michael Paquier
psql: Add ignore_slash_options in bind's inactive branch All commands accepting arguments, handling them with OT_NORMAL, OT_SQLID or OT_SQLIDHACK, should call ignore_slash_options() in inactive branch to scan and discard extra arguments. All the backslash commands that handle arguments do so,

pgsql: Fix incorrect placeholder in walreceiver.c

2024-01-18 Thread Michael Paquier
Fix incorrect placeholder in walreceiver.c Author: Yongtao Huang Discussion: https://postgr.es/m/caoe1go3h7cgrsceo+hbhnoptk-mjhii-yt8d19cikkintjw...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3ada0d2cae4d9d3e045c72e3ee0b37ccb6e13902 Modified

pgsql: Improve handling of dropped partitioned indexes for REINDEX INDE

2024-01-17 Thread Michael Paquier
Improve handling of dropped partitioned indexes for REINDEX INDEX A REINDEX INDEX done on a partitioned index builds a list of the indexes to work on before processing its partitions in individual transactions. When combined with a DROP of the partitioned index, there was a window where it was

pgsql: Improve handling of dropped partitioned indexes for REINDEX INDE

2024-01-17 Thread Michael Paquier
Improve handling of dropped partitioned indexes for REINDEX INDEX A REINDEX INDEX done on a partitioned index builds a list of the indexes to work on before processing its partitions in individual transactions. When combined with a DROP of the partitioned index, there was a window where it was

pgsql: Improve handling of dropped partitioned indexes for REINDEX INDE

2024-01-17 Thread Michael Paquier
Improve handling of dropped partitioned indexes for REINDEX INDEX A REINDEX INDEX done on a partitioned index builds a list of the indexes to work on before processing its partitions in individual transactions. When combined with a DROP of the partitioned index, there was a window where it was

pgsql: Improve handling of dropped partitioned indexes for REINDEX INDE

2024-01-17 Thread Michael Paquier
Improve handling of dropped partitioned indexes for REINDEX INDEX A REINDEX INDEX done on a partitioned index builds a list of the indexes to work on before processing its partitions in individual transactions. When combined with a DROP of the partitioned index, there was a window where it was

pgsql: Add try_index_open(), conditional variant of index_open()

2024-01-17 Thread Michael Paquier
Add try_index_open(), conditional variant of index_open() try_index_open() is able to open an index if its relkind fits, except that it would return NULL instead of generated an error if the relation does not exist. This new routine will be used by an upcoming patch to make REINDEX on

pgsql: Add try_index_open(), conditional variant of index_open()

2024-01-17 Thread Michael Paquier
Add try_index_open(), conditional variant of index_open() try_index_open() is able to open an index if its relkind fits, except that it would return NULL instead of generated an error if the relation does not exist. This new routine will be used by an upcoming patch to make REINDEX on

pgsql: Add try_index_open(), conditional variant of index_open()

2024-01-17 Thread Michael Paquier
Add try_index_open(), conditional variant of index_open() try_index_open() is able to open an index if its relkind fits, except that it would return NULL instead of generated an error if the relation does not exist. This new routine will be used by an upcoming patch to make REINDEX on

pgsql: Add try_index_open(), conditional variant of index_open()

2024-01-17 Thread Michael Paquier
Add try_index_open(), conditional variant of index_open() try_index_open() is able to open an index if its relkind fits, except that it would return NULL instead of generated an error if the relation does not exist. This new routine will be used by an upcoming patch to make REINDEX on

pgsql: lwlock: Fix quadratic behavior with very long wait lists

2024-01-17 Thread Michael Paquier
lwlock: Fix quadratic behavior with very long wait lists Until now LWLockDequeueSelf() sequentially searched the list of waiters to see if the current proc is still is on the list of waiters, or has already been removed. In extreme workloads, where the wait lists are very long, this leads to a

pgsql: lwlock: Fix quadratic behavior with very long wait lists

2024-01-17 Thread Michael Paquier
lwlock: Fix quadratic behavior with very long wait lists Until now LWLockDequeueSelf() sequentially searched the list of waiters to see if the current proc is still is on the list of waiters, or has already been removed. In extreme workloads, where the wait lists are very long, this leads to a

pgsql: lwlock: Fix quadratic behavior with very long wait lists

2024-01-17 Thread Michael Paquier
lwlock: Fix quadratic behavior with very long wait lists Until now LWLockDequeueSelf() sequentially searched the list of waiters to see if the current proc is still is on the list of waiters, or has already been removed. In extreme workloads, where the wait lists are very long, this leads to a

pgsql: lwlock: Fix quadratic behavior with very long wait lists

2024-01-17 Thread Michael Paquier
lwlock: Fix quadratic behavior with very long wait lists Until now LWLockDequeueSelf() sequentially searched the list of waiters to see if the current proc is still is on the list of waiters, or has already been removed. In extreme workloads, where the wait lists are very long, this leads to a

pgsql: seg: Add test "security" in meson.build

2024-01-17 Thread Michael Paquier
seg: Add test "security" in meson.build Oversight in 681d9e4621aa where the test has been added. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/zk5agyxg4zler...@telsasoft.com Backpatch-through: 16 Branch -- master Details ---

pgsql: seg: Add test "security" in meson.build

2024-01-17 Thread Michael Paquier
seg: Add test "security" in meson.build Oversight in 681d9e4621aa where the test has been added. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/zk5agyxg4zler...@telsasoft.com Backpatch-through: 16 Branch -- REL_16_STABLE Details ---

pgsql: Fix description of DecodeInsert() in decode.c

2024-01-17 Thread Michael Paquier
Fix description of DecodeInsert() in decode.c This incorrectly referred to deletes. Author: Yongtao Huang Reviewed-by: Richard Guo Description: https://postgr.es/m/CAOe1Go0Czgvo9eiDqeFpaABwJu=gBK6qjrYzZGZLn=tkdx8...@mail.gmail.com Branch -- master Details ---

pgsql: Remove some comments related to pqPipelineSync() and PQsendPipel

2024-01-16 Thread Michael Paquier
Remove some comments related to pqPipelineSync() and PQsendPipelineSync() These comments explained how these functions behave internally, and the equivalent is described in the documentation section dedicated to the pipeline mode of libpq. Let's remove these comments, getting rid of the

pgsql: Add support for parsing of large XML data (>= 10MB)

2024-01-16 Thread Michael Paquier
mit. This change affects the contrib module xml2, the xml data type and SQL/XML. Author: Dmitry Koval Reviewed-by: Tom Lane, Michael Paquier Discussion: https://postgr.es/m/18274-98d16bc035206...@postgresql.org Branch -- master Details --- https://git.postgresql.org/pg/commitd

pgsql: xml2: Replace deprecated routines with recommended ones

2024-01-16 Thread Michael Paquier
xml2: Replace deprecated routines with recommended ones Some functions are used in the tree and are currently marked as deprecated by upstream. This commit refreshes the code to use the recommended functions, leading to the following changes: - xmlSubstituteEntitiesDefault() is gone, and needs

pgsql: libpq: Add PQsendPipelineSync()

2024-01-15 Thread Michael Paquier
overhead of pipeline mode, by giving to applications more control over the timing of the flushes when manipulating commands in pipeline mode. Author: Anton Kirilov Reviewed-by: Jelte Fennema-Nio, Robert Haas, Álvaro Herrera, Denis Laxalde, Michael Paquier Discussion: https://postgr.es/m

pgsql: Fix a typo and some doc indentation related to libpq pipeline fu

2024-01-15 Thread Michael Paquier
Fix a typo and some doc indentation related to libpq pipeline functions Noticed while reviewing the area for a different patch. This is cosmetic, so no backpatch is done. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/83eb244e419efd43959fdd544ff8c30e175565ef

pgsql: Reduce dependency to money data type in main regression test sui

2024-01-14 Thread Michael Paquier
Reduce dependency to money data type in main regression test suite Most of these tests have been introduced in 6dd8b0080787, to check for behaviors related to hashing and hash plans, and money is a data type with btree support but no hash functions. These tests are switched to use varbit

pgsql: pg_regress: Disable autoruns for cmd.exe on Windows

2024-01-11 Thread Michael Paquier
pg_regress: Disable autoruns for cmd.exe on Windows This is similar to 9886744a361b, to prevent the execution of other programs due to autorun configurations which could influence the postmaster startup. This was originally applied on HEAD as of 83c75ac7fb69 without a backpatch, but the patch

pgsql: pg_regress: Disable autoruns for cmd.exe on Windows

2024-01-11 Thread Michael Paquier
pg_regress: Disable autoruns for cmd.exe on Windows This is similar to 9886744a361b, to prevent the execution of other programs due to autorun configurations which could influence the postmaster startup. This was originally applied on HEAD as of 83c75ac7fb69 without a backpatch, but the patch

pgsql: pg_regress: Disable autoruns for cmd.exe on Windows

2024-01-11 Thread Michael Paquier
pg_regress: Disable autoruns for cmd.exe on Windows This is similar to 9886744a361b, to prevent the execution of other programs due to autorun configurations which could influence the postmaster startup. This was originally applied on HEAD as of 83c75ac7fb69 without a backpatch, but the patch

pgsql: pg_regress: Disable autoruns for cmd.exe on Windows

2024-01-11 Thread Michael Paquier
pg_regress: Disable autoruns for cmd.exe on Windows This is similar to 9886744a361b, to prevent the execution of other programs due to autorun configurations which could influence the postmaster startup. This was originally applied on HEAD as of 83c75ac7fb69 without a backpatch, but the patch

pgsql: pg_regress: Disable autoruns for cmd.exe on Windows

2024-01-11 Thread Michael Paquier
pg_regress: Disable autoruns for cmd.exe on Windows This is similar to 9886744a361b, to prevent the execution of other programs due to autorun configurations which could influence the postmaster startup. This was originally applied on HEAD as of 83c75ac7fb69 without a backpatch, but the patch

pgsql: pg_ctl: Disable autoruns for cmd.exe on Windows

2024-01-11 Thread Michael Paquier
this change work correctly in the oldest branches still supported. Reported-by: Hayato Kuroda Author: Kyotaro Horiguchi Reviewed-by: Robert Haas, Michael Paquier Discussion: https://postgr.es/m/20230922.161551.320043332510268554.horikyota@gmail.com Backpatch-through: 12 Branch -- REL_16_STABLE

pgsql: pg_ctl: Disable autoruns for cmd.exe on Windows

2024-01-11 Thread Michael Paquier
this change work correctly in the oldest branches still supported. Reported-by: Hayato Kuroda Author: Kyotaro Horiguchi Reviewed-by: Robert Haas, Michael Paquier Discussion: https://postgr.es/m/20230922.161551.320043332510268554.horikyota@gmail.com Backpatch-through: 12 Branch -- REL_12_STABLE

pgsql: pg_ctl: Disable autoruns for cmd.exe on Windows

2024-01-11 Thread Michael Paquier
this change work correctly in the oldest branches still supported. Reported-by: Hayato Kuroda Author: Kyotaro Horiguchi Reviewed-by: Robert Haas, Michael Paquier Discussion: https://postgr.es/m/20230922.161551.320043332510268554.horikyota@gmail.com Backpatch-through: 12 Branch -- REL_13_STABLE

pgsql: pg_ctl: Disable autoruns for cmd.exe on Windows

2024-01-11 Thread Michael Paquier
this change work correctly in the oldest branches still supported. Reported-by: Hayato Kuroda Author: Kyotaro Horiguchi Reviewed-by: Robert Haas, Michael Paquier Discussion: https://postgr.es/m/20230922.161551.320043332510268554.horikyota@gmail.com Backpatch-through: 12 Branch -- REL_14_STABLE

pgsql: pg_ctl: Disable autoruns for cmd.exe on Windows

2024-01-11 Thread Michael Paquier
this change work correctly in the oldest branches still supported. Reported-by: Hayato Kuroda Author: Kyotaro Horiguchi Reviewed-by: Robert Haas, Michael Paquier Discussion: https://postgr.es/m/20230922.161551.320043332510268554.horikyota@gmail.com Backpatch-through: 12 Branch -- REL_15_STABLE

pgsql: Fix pg_walsummary's .gitignore

2024-01-11 Thread Michael Paquier
Fix pg_walsummary's .gitignore It missed a entry for tmp_check/ generated by the tests. While on it, append a slash at the beginning of "pg_walsummary" to restrict its check to the current directory, like anywhere else. Oversights in ee1bfd168390. Branch -- master Details ---

pgsql: Refactor code checking for file existence

2024-01-11 Thread Michael Paquier
Refactor code checking for file existence jit.c and dfgr.c had a copy of the same code to check if a file exists or not, with a twist: jit.c did not check for EACCES when failing the stat() call for the path whose existence is tested. This refactored routine will be used by an upcoming patch.

pgsql: Rework how logirep launchers are stopped during pg_upgrade

2024-01-11 Thread Michael Paquier
Rework how logirep launchers are stopped during pg_upgrade This is a rework of 7021d3b17664, where we relied on forcing max_logical_replication_workers to 0 in the postgres command. This commit now prevents logical replication launchers to start using -b and a backend-side check based on

pgsql: pg_regress: Disable autoruns for cmd.exe on Windows

2024-01-10 Thread Michael Paquier
pg_regress: Disable autoruns for cmd.exe on Windows This is similar to 9886744a361b, to prevent the execution of other programs due to autorun configurations which could influence the postmaster startup. Like the other change, no backpatch is done. Discussion:

pgsql: pg_ctl: Disable autoruns for cmd.exe on Windows

2024-01-09 Thread Michael Paquier
to the launcher cmd.exe command line to disable autorun settings written in the registry. This is arguably a bug, but no backpatch is done now out of caution. Reported-by: Hayato Kuroda Author: Kyotaro Horiguchi Reviewed-by: Robert Haas, Michael Paquier Discussion: https://postgr.es/m

pgsql: Fix corruption of local buffer state during extend of temp relat

2024-01-05 Thread Michael Paquier
kind of ERROR during the relation extend (like partial writes or some other errno). Reported-by: Alexander Lakhin Author: Tender Wang Reviewed-by: Richard Guo, Alexander Lakhin, Michael Paquier Discussion: https://postgr.es/m/18259-6e256429825dd...@postgresql.org Backpatch-through: 16 Branch

pgsql: Fix corruption of local buffer state during extend of temp relat

2024-01-05 Thread Michael Paquier
kind of ERROR during the relation extend (like partial writes or some other errno). Reported-by: Alexander Lakhin Author: Tender Wang Reviewed-by: Richard Guo, Alexander Lakhin, Michael Paquier Discussion: https://postgr.es/m/18259-6e256429825dd...@postgresql.org Backpatch-through: 16 Branch

pgsql: doc: fix typo "vertexes" -> "vertices"

2024-01-03 Thread Michael Paquier
doc: fix typo "vertexes" -> "vertices" The "vertexes" spelling is also valid, but we consistently use "vertices" elsewhere. Author: Dagfinn Ilmari Mannsåker Reviewed-by: Shubham Khanna Discussion: https://postgr.es/m/87le9fmi01@wibble.ilmari.org Branch -- master Details ---

pgsql: Fix some typos

2024-01-02 Thread Michael Paquier
Fix some typos Author: Dagfinn Ilmari Mannsåker Reviewed-by: Shubham Khanna Discussion: https://postgr.es/m/87le9fmi01@wibble.ilmari.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/359a3c586d7f2fdcb7d919bcc8822993b47ada1c Modified Files --

pgsql: Remove unnecessary PGDATABASE settings from TAP tests

2024-01-02 Thread Michael Paquier
Remove unnecessary PGDATABASE settings from TAP tests Some of the TAP tests have been historically setting the environment variable PGDATABASE to 'postgres', which is not needed because PostgreSQL::Test::Cluster already sets it when initialized. This commit removes these explicit setups. Note

pgsql: Exclude files generated by generate-wait_event_types.pl from pgi

2023-12-31 Thread Michael Paquier
Exclude files generated by generate-wait_event_types.pl from pgindent The format of these files becomes arguably worse after being indented, and, as they are generated, there is no point in applying an indentation anyway. Author: Bharath Rupireddy Discussion:

pgsql: doc: Mention AttributeRelationId in FDW validator function descr

2023-12-28 Thread Michael Paquier
doc: Mention AttributeRelationId in FDW validator function description The documentation has been missing one value in the list of catalog OIDs that can be given to the validator function of a FDW, as of AttributeRelationId, when changing the attribute options of a foreign table. Author: Ian

pgsql: doc: Mention AttributeRelationId in FDW validator function descr

2023-12-28 Thread Michael Paquier
doc: Mention AttributeRelationId in FDW validator function description The documentation has been missing one value in the list of catalog OIDs that can be given to the validator function of a FDW, as of AttributeRelationId, when changing the attribute options of a foreign table. Author: Ian

<    1   2   3   4   5   6   7   8   9   10   >