pgsql: Doc: clarify enable_indexscan=off also disabled Index Only Scans

2024-10-28 Thread David Rowley
Doc: clarify enable_indexscan=off also disabled Index Only Scans Disabling enable_indexscan has always also disabled Index Only Scans. Here we make that more clear in the documentation in an attempt to prevent future complaints complaining about this expected behavior. Reported-by: Melanie Plagem

pgsql: Fix dependency of partitioned table and table AM with CREATE TAB

2024-10-28 Thread Michael Paquier
Fix dependency of partitioned table and table AM with CREATE TABLE .. USING A pg_depend entry between a partitioned table and its table access method was missing when using CREATE TABLE .. USING with an unpinned access method. DROP ACCESS METHOD could be used, while it should be blocked if CASCAD

pgsql: Fix dependency of partitioned table and table AM with CREATE TAB

2024-10-28 Thread Michael Paquier
Fix dependency of partitioned table and table AM with CREATE TABLE .. USING A pg_depend entry between a partitioned table and its table access method was missing when using CREATE TABLE .. USING with an unpinned access method. DROP ACCESS METHOD could be used, while it should be blocked if CASCAD

Re: pgsql: Change the default value of the streaming option to 'parallel'.

2024-10-28 Thread Amit Kapila
On Mon, Oct 28, 2024 at 8:55 AM Amit Kapila wrote: > > Change the default value of the streaming option to 'parallel'. ... > > Reported-by: Vignesh C > Author: Hayato Kuroda, Masahiko Sawada, Peter Smith, Amit Kapila > Discussion: > https://postgr.es/m/CALDaNm1=medhw23nuoepjtmonwsmsp80ddsw+sejs

pgsql: Doc: clarify enable_indexscan=off also disabled Index Only Scans

2024-10-28 Thread David Rowley
Doc: clarify enable_indexscan=off also disabled Index Only Scans Disabling enable_indexscan has always also disabled Index Only Scans. Here we make that more clear in the documentation in an attempt to prevent future complaints complaining about this expected behavior. Reported-by: Melanie Plagem

pgsql: Doc: clarify enable_indexscan=off also disabled Index Only Scans

2024-10-28 Thread David Rowley
Doc: clarify enable_indexscan=off also disabled Index Only Scans Disabling enable_indexscan has always also disabled Index Only Scans. Here we make that more clear in the documentation in an attempt to prevent future complaints complaining about this expected behavior. Reported-by: Melanie Plagem

pgsql: Doc: clarify enable_indexscan=off also disabled Index Only Scans

2024-10-28 Thread David Rowley
Doc: clarify enable_indexscan=off also disabled Index Only Scans Disabling enable_indexscan has always also disabled Index Only Scans. Here we make that more clear in the documentation in an attempt to prevent future complaints complaining about this expected behavior. Reported-by: Melanie Plagem

pgsql: Doc: clarify enable_indexscan=off also disabled Index Only Scans

2024-10-28 Thread David Rowley
Doc: clarify enable_indexscan=off also disabled Index Only Scans Disabling enable_indexscan has always also disabled Index Only Scans. Here we make that more clear in the documentation in an attempt to prevent future complaints complaining about this expected behavior. Reported-by: Melanie Plagem

pgsql: Doc: clarify enable_indexscan=off also disabled Index Only Scans

2024-10-28 Thread David Rowley
Doc: clarify enable_indexscan=off also disabled Index Only Scans Disabling enable_indexscan has always also disabled Index Only Scans. Here we make that more clear in the documentation in an attempt to prevent future complaints complaining about this expected behavior. Reported-by: Melanie Plagem

pgsql: doc: Add better description for rewrite functions in event trigg

2024-10-28 Thread Michael Paquier
doc: Add better description for rewrite functions in event triggers There are two functions that can be used in event triggers to get more details about a rewrite happening on a relation. Both had a limited documentation: - pg_event_trigger_table_rewrite_reason() and pg_event_trigger_table_rewrit

pgsql: Doc: clarify enable_indexscan=off also disabled Index Only Scans

2024-10-28 Thread David Rowley
Doc: clarify enable_indexscan=off also disabled Index Only Scans Disabling enable_indexscan has always also disabled Index Only Scans. Here we make that more clear in the documentation in an attempt to prevent future complaints complaining about this expected behavior. Reported-by: Melanie Plagem

pgsql: doc: Add better description for rewrite functions in event trigg

2024-10-28 Thread Michael Paquier
doc: Add better description for rewrite functions in event triggers There are two functions that can be used in event triggers to get more details about a rewrite happening on a relation. Both had a limited documentation: - pg_event_trigger_table_rewrite_reason() and pg_event_trigger_table_rewrit

pgsql: doc: Add better description for rewrite functions in event trigg

2024-10-28 Thread Michael Paquier
doc: Add better description for rewrite functions in event triggers There are two functions that can be used in event triggers to get more details about a rewrite happening on a relation. Both had a limited documentation: - pg_event_trigger_table_rewrite_reason() and pg_event_trigger_table_rewrit

pgsql: doc: Add better description for rewrite functions in event trigg

2024-10-28 Thread Michael Paquier
doc: Add better description for rewrite functions in event triggers There are two functions that can be used in event triggers to get more details about a rewrite happening on a relation. Both had a limited documentation: - pg_event_trigger_table_rewrite_reason() and pg_event_trigger_table_rewrit

pgsql: doc: Add better description for rewrite functions in event trigg

2024-10-28 Thread Michael Paquier
doc: Add better description for rewrite functions in event triggers There are two functions that can be used in event triggers to get more details about a rewrite happening on a relation. Both had a limited documentation: - pg_event_trigger_table_rewrite_reason() and pg_event_trigger_table_rewrit

pgsql: Remove unused #include's from contrib, pl, test .c files

2024-10-28 Thread Peter Eisentraut
Remove unused #include's from contrib, pl, test .c files as determined by IWYU Similar to commit dbbca2cf299, but for contrib, pl, and src/test/. Reviewed-by: Alvaro Herrera Discussion: https://www.postgresql.org/message-id/flat/0df1d5b1-8ca8-4f84-93be-121081bde049%40eisentraut.org Branch ---

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-10-28 Thread Heikki Linnakangas
On 25/10/2024 14:56, Alexander Korotkov wrote: I see that pg_wal_replay_wait_status() might look weird, but it seems to me like the best of feasible solutions. I haven't written many procedures, but our docs say: > Procedures do not return a function value; hence CREATE PROCEDURE lacks a RET

pgsql: nbtree: Minor sibling link traversal tweaks.

2024-10-28 Thread Peter Geoghegan
nbtree: Minor sibling link traversal tweaks. Tweak some code comments for clarity, and relocate some local variable declarations to the scope where they're actually used. Follow-up to recent commit 1bd4bc85. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/123474cbc

pgsql: Fix WAL_DEBUG build

2024-10-28 Thread Peter Eisentraut
Fix WAL_DEBUG build broken by commit e18512c000e Reported-by: Peter Geoghegan Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8a98822bcc37c03baf44ec39d8e88d9c24647b9d Modified Files -- src/backend/access/transam/xlog.c | 4 1 file changed, 4 inser

Re: pgsql: Remove unused #include's from contrib, pl, test .c files

2024-10-28 Thread Peter Eisentraut
On 28.10.24 16:56, Peter Geoghegan wrote: On Mon, Oct 28, 2024 at 11:48 AM Peter Geoghegan wrote: This broke WAL_DEBUG builds, which rely on TopMemoryContext within xlog.c. Minor correction: it was actually commit e18512c0, not this similar commit. fixed

pgsql: Fix overflow in bsearch_arg() with more than INT_MAX elements

2024-10-28 Thread Heikki Linnakangas
Fix overflow in bsearch_arg() with more than INT_MAX elements This was introduced in commit bfa2cee784, which replaced the old bsearch_cmp() function we had in extended_stats.c with the current implementation. The original discussion or commit message of bfa2cee784 didn't mention where the new imp

Re: pgsql: Remove unused #include's from contrib, pl, test .c files

2024-10-28 Thread Peter Geoghegan
On Mon, Oct 28, 2024 at 3:03 AM Peter Eisentraut wrote: > Remove unused #include's from contrib, pl, test .c files This broke WAL_DEBUG builds, which rely on TopMemoryContext within xlog.c. -- Peter Geoghegan

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-10-28 Thread Robert Haas
Point of order: Discussions of commits and potential followup commits are best redirected to -hackers rather than continuing to use -committers. ...Robert

Re: pgsql: Remove unused #include's from contrib, pl, test .c files

2024-10-28 Thread Peter Geoghegan
On Mon, Oct 28, 2024 at 11:48 AM Peter Geoghegan wrote: > This broke WAL_DEBUG builds, which rely on TopMemoryContext within xlog.c. Minor correction: it was actually commit e18512c0, not this similar commit. -- Peter Geoghegan

pgsql: Strip Windows newlines from extension script files manually.

2024-10-28 Thread Tom Lane
Strip Windows newlines from extension script files manually. Revert commit 924e03917 in favor of adding code to convert \r\n to \n explicitly, on Windows only. The idea of letting text mode do the work fails for a couple of reasons: * Per Microsoft documentation, text mode also causes control-Z

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-10-28 Thread Alexander Korotkov
On Mon, Oct 28, 2024 at 5:47 PM Robert Haas wrote: > Point of order: > > Discussions of commits and potential followup commits are best > redirected to -hackers rather than continuing to use -committers. Thank you for pointing this. My response to Heikki's last message will be redirected to -hack

pgsql: Guard against enormously long input in pg_saslprep().

2024-10-28 Thread Tom Lane
Guard against enormously long input in pg_saslprep(). Coverity complained that pg_saslprep() could suffer integer overflow, leading to under-allocation of the output buffer, if the input string exceeds SIZE_MAX/4. This hazard seems largely hypothetical, but it's easy enough to defend against, so

pgsql: Guard against enormously long input in pg_saslprep().

2024-10-28 Thread Tom Lane
Guard against enormously long input in pg_saslprep(). Coverity complained that pg_saslprep() could suffer integer overflow, leading to under-allocation of the output buffer, if the input string exceeds SIZE_MAX/4. This hazard seems largely hypothetical, but it's easy enough to defend against, so

pgsql: Guard against enormously long input in pg_saslprep().

2024-10-28 Thread Tom Lane
Guard against enormously long input in pg_saslprep(). Coverity complained that pg_saslprep() could suffer integer overflow, leading to under-allocation of the output buffer, if the input string exceeds SIZE_MAX/4. This hazard seems largely hypothetical, but it's easy enough to defend against, so

pgsql: Guard against enormously long input in pg_saslprep().

2024-10-28 Thread Tom Lane
Guard against enormously long input in pg_saslprep(). Coverity complained that pg_saslprep() could suffer integer overflow, leading to under-allocation of the output buffer, if the input string exceeds SIZE_MAX/4. This hazard seems largely hypothetical, but it's easy enough to defend against, so

pgsql: Unify src/common/'s definitions of MaxAllocSize.

2024-10-28 Thread Tom Lane
Unify src/common/'s definitions of MaxAllocSize. As threatened in the previous patch, define MaxAllocSize in src/include/common/fe_memutils.h rather than having several copies of it in different src/common/*.c files. This also provides an opportunity to document it better. While this would proba

pgsql: Restore missing line to copyright notice

2024-10-28 Thread Heikki Linnakangas
Restore missing line to copyright notice Commit 12c9423832 in May 2003 accidentally removed the last line of the copyright notice in getopt.c. Put it back. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/22bb889f7080d5a2596df2276ccbdb1ace1e4673 Modified Files -

pgsql: Fix overflow in bsearch_arg() with more than INT_MAX elements

2024-10-28 Thread Heikki Linnakangas
Fix overflow in bsearch_arg() with more than INT_MAX elements This was introduced in commit bfa2cee784, which replaced the old bsearch_cmp() function we had in extended_stats.c with the current implementation. The original discussion or commit message of bfa2cee784 didn't mention where the new imp

pgsql: Fix overflow in bsearch_arg() with more than INT_MAX elements

2024-10-28 Thread Heikki Linnakangas
Fix overflow in bsearch_arg() with more than INT_MAX elements This was introduced in commit bfa2cee784, which replaced the old bsearch_cmp() function we had in extended_stats.c with the current implementation. The original discussion or commit message of bfa2cee784 didn't mention where the new imp

pgsql: Fix overflow in bsearch_arg() with more than INT_MAX elements

2024-10-28 Thread Heikki Linnakangas
Fix overflow in bsearch_arg() with more than INT_MAX elements This was introduced in commit bfa2cee784, which replaced the old bsearch_cmp() function we had in extended_stats.c with the current implementation. The original discussion or commit message of bfa2cee784 didn't mention where the new imp

pgsql: Fix overflow in bsearch_arg() with more than INT_MAX elements

2024-10-28 Thread Heikki Linnakangas
Fix overflow in bsearch_arg() with more than INT_MAX elements This was introduced in commit bfa2cee784, which replaced the old bsearch_cmp() function we had in extended_stats.c with the current implementation. The original discussion or commit message of bfa2cee784 didn't mention where the new imp

pgsql: Ensure we have a snapshot when updating pg_index in index_drop()

2024-10-28 Thread Nathan Bossart
Ensure we have a snapshot when updating pg_index in index_drop(). I assumed that all index_drop() callers set an active snapshot beforehand, but that is evidently not true. One counterexample is autovacuum, which doesn't set an active snapshot when cleaning up orphan temp indexes. To fix, uncond

pgsql: Guard against enormously long input in pg_saslprep().

2024-10-28 Thread Tom Lane
Guard against enormously long input in pg_saslprep(). Coverity complained that pg_saslprep() could suffer integer overflow, leading to under-allocation of the output buffer, if the input string exceeds SIZE_MAX/4. This hazard seems largely hypothetical, but it's easy enough to defend against, so