pgsql: pageinspect: Fix handling of all-zero pages

2022-04-13 Thread Michael Paquier
pageinspect: Fix handling of all-zero pages Getting from get_raw_page() an all-zero page is considered as a valid case by the buffer manager and it can happen for example when finding a corrupted page with zero_damaged_pages enabled (using zero_damaged_pages to look at corrupted pages happens), or

pgsql: pageinspect: Fix handling of all-zero pages

2022-04-13 Thread Michael Paquier
pageinspect: Fix handling of all-zero pages Getting from get_raw_page() an all-zero page is considered as a valid case by the buffer manager and it can happen for example when finding a corrupted page with zero_damaged_pages enabled (using zero_damaged_pages to look at corrupted pages happens), or

pgsql: pageinspect: Fix handling of all-zero pages

2022-04-13 Thread Michael Paquier
pageinspect: Fix handling of all-zero pages Getting from get_raw_page() an all-zero page is considered as a valid case by the buffer manager and it can happen for example when finding a corrupted page with zero_damaged_pages enabled (using zero_damaged_pages to look at corrupted pages happens), or

pgsql: pageinspect: Fix handling of all-zero pages

2022-04-13 Thread Michael Paquier
pageinspect: Fix handling of all-zero pages Getting from get_raw_page() an all-zero page is considered as a valid case by the buffer manager and it can happen for example when finding a corrupted page with zero_damaged_pages enabled (using zero_damaged_pages to look at corrupted pages happens), or

pgsql: pageinspect: Fix handling of all-zero pages

2022-04-13 Thread Michael Paquier
pageinspect: Fix handling of all-zero pages Getting from get_raw_page() an all-zero page is considered as a valid case by the buffer manager and it can happen for example when finding a corrupted page with zero_damaged_pages enabled (using zero_damaged_pages to look at corrupted pages happens), or

pgsql: pageinspect: Fix handling of all-zero pages

2022-04-13 Thread Michael Paquier
pageinspect: Fix handling of all-zero pages Getting from get_raw_page() an all-zero page is considered as a valid case by the buffer manager and it can happen for example when finding a corrupted page with zero_damaged_pages enabled (using zero_damaged_pages to look at corrupted pages happens), or

pgsql: Add missing spaces after single-line comments

2022-04-13 Thread David Rowley
Add missing spaces after single-line comments Only 1 of 3 of these changes appear to be handled by pgindent. That change is new to v15. The remaining two appear to be left alone by pgindent. The exact reason for that is not 100% clear to me. It seems related to the fact that it's a line that con

pgsql: Docs: fix some spelling mistakes and also do some wordsmithing

2022-04-13 Thread David Rowley
Docs: fix some spelling mistakes and also do some wordsmithing All except one of these are new to v15. Only one of the wordsmithing changes appears in older versions. The wordsmithing improvement does not seem significant enough to warrant backpatching. Author: Justin Pryzby Discussion: https://

pgsql: Fix case sensitivity in psql's tab completion for GUC names.

2022-04-13 Thread Tom Lane
Fix case sensitivity in psql's tab completion for GUC names. Input for these should be case-insensitive, but was not completely so. Comparing to the similar queries for timezone names, I realized that we'd missed forcing the comparison pattern to lower-case. With that, it behaves as I expect. Wh

pgsql: Further tweak the default behavior of psql's \dconfig.

2022-04-13 Thread Tom Lane
Further tweak the default behavior of psql's \dconfig. Define "parameters with non-default settings" as being those that not only have pg_settings.source different from 'default', but also have a current value different from the hard-wired boot_val. Adding the latter restriction removes a number o

pgsql: Prevent access to no-longer-pinned buffer in heapam_tuple_lock()

2022-04-13 Thread Tom Lane
Prevent access to no-longer-pinned buffer in heapam_tuple_lock(). heap_fetch() used to have a "keep_buf" parameter that told it to return ownership of the buffer pin to the caller after finding that the requested tuple TID exists but is invisible to the specified snapshot. This was thoughtlessly r

pgsql: Prevent access to no-longer-pinned buffer in heapam_tuple_lock()

2022-04-13 Thread Tom Lane
Prevent access to no-longer-pinned buffer in heapam_tuple_lock(). heap_fetch() used to have a "keep_buf" parameter that told it to return ownership of the buffer pin to the caller after finding that the requested tuple TID exists but is invisible to the specified snapshot. This was thoughtlessly r

pgsql: Prevent access to no-longer-pinned buffer in heapam_tuple_lock()

2022-04-13 Thread Tom Lane
Prevent access to no-longer-pinned buffer in heapam_tuple_lock(). heap_fetch() used to have a "keep_buf" parameter that told it to return ownership of the buffer pin to the caller after finding that the requested tuple TID exists but is invisible to the specified snapshot. This was thoughtlessly r

pgsql: Prevent access to no-longer-pinned buffer in heapam_tuple_lock()

2022-04-13 Thread Tom Lane
Prevent access to no-longer-pinned buffer in heapam_tuple_lock(). heap_fetch() used to have a "keep_buf" parameter that told it to return ownership of the buffer pin to the caller after finding that the requested tuple TID exists but is invisible to the specified snapshot. This was thoughtlessly r

pgsql: Remove extraneous blank lines before block-closing braces

2022-04-13 Thread Alvaro Herrera
Remove extraneous blank lines before block-closing braces These are useless and distracting. We wouldn't have written the code with them to begin with, so there's no reason to keep them. Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Discussion: http

pgsql: Release cache tuple when no longer needed

2022-04-13 Thread Alvaro Herrera
Release cache tuple when no longer needed There was a small buglet in commit 52e4f0cd472d whereby a tuple acquired from cache was not released, giving rise to WARNING messages; fix that. While at it, restructure the code a bit on stylistic grounds. Author: Hou zj Reported-by: Peter Smith Revie

pgsql: Fix finalization for json_objectagg and friends

2022-04-13 Thread Andrew Dunstan
Fix finalization for json_objectagg and friends Commit f4fb45d15c misguidedly tried to free some state during aggregate finalization for json_objectagg. This resulted in attempts to access freed memory, especially when the function is used as a window function. Commit 4eb9798879 attempted to ameli

pgsql: Fix incorrect format placeholders

2022-04-13 Thread Peter Eisentraut
Fix incorrect format placeholders Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a038679cd876f63e17a08f64fafad27cd5bc23fe Modified Files -- src/backend/utils/error/jsonlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Docs: wording improvement for compute_query_id = regress

2022-04-13 Thread David Rowley
Docs: wording improvement for compute_query_id = regress It's more accurate to say that the query identifier is not shown when compute_query_id = regress rather than to say it is hidden. This change (ebf6c5249) appeared in v14, so it makes sense to backpatch this small adjustment to keep the docu

pgsql: Docs: wording improvement for compute_query_id = regress

2022-04-13 Thread David Rowley
Docs: wording improvement for compute_query_id = regress It's more accurate to say that the query identifier is not shown when compute_query_id = regress rather than to say it is hidden. This change (ebf6c5249) appeared in v14, so it makes sense to backpatch this small adjustment to keep the docu