pgsql: Improve the implementation of information_schema._pg_expandarray

2023-12-27 Thread Tom Lane
Improve the implementation of information_schema._pg_expandarray(). This function was originally coded with a handmade expansion of the array subscripts. We can do it a little faster and far more legibly today, by using unnest() WITH ORDINALITY. While at it, let's apply the rowcount estimation s

pgsql: Doc: specify aclitem syntax more clearly.

2023-12-27 Thread Tom Lane
Doc: specify aclitem syntax more clearly. The previous wording here relied solely on an example to explain aclitem output format. Add an actual syntax synopsis and explanation of the elements to make it clearer. David Johnston and Tom Lane, per gripe from Eugen Konkov. Discussion: https://post

pgsql: Doc: specify aclitem syntax more clearly.

2023-12-27 Thread Tom Lane
Doc: specify aclitem syntax more clearly. The previous wording here relied solely on an example to explain aclitem output format. Add an actual syntax synopsis and explanation of the elements to make it clearer. David Johnston and Tom Lane, per gripe from Eugen Konkov. Discussion: https://post

pgsql: Doc: specify aclitem syntax more clearly.

2023-12-27 Thread Tom Lane
Doc: specify aclitem syntax more clearly. The previous wording here relied solely on an example to explain aclitem output format. Add an actual syntax synopsis and explanation of the elements to make it clearer. David Johnston and Tom Lane, per gripe from Eugen Konkov. Discussion: https://post

pgsql: Doc: specify aclitem syntax more clearly.

2023-12-27 Thread Tom Lane
Doc: specify aclitem syntax more clearly. The previous wording here relied solely on an example to explain aclitem output format. Add an actual syntax synopsis and explanation of the elements to make it clearer. David Johnston and Tom Lane, per gripe from Eugen Konkov. Discussion: https://post

pgsql: Doc: specify aclitem syntax more clearly.

2023-12-27 Thread Tom Lane
Doc: specify aclitem syntax more clearly. The previous wording here relied solely on an example to explain aclitem output format. Add an actual syntax synopsis and explanation of the elements to make it clearer. David Johnston and Tom Lane, per gripe from Eugen Konkov. Discussion: https://post

pgsql: Doc: specify aclitem syntax more clearly.

2023-12-27 Thread Tom Lane
Doc: specify aclitem syntax more clearly. The previous wording here relied solely on an example to explain aclitem output format. Add an actual syntax synopsis and explanation of the elements to make it clearer. David Johnston and Tom Lane, per gripe from Eugen Konkov. Discussion: https://post

pgsql: Fix another incorrect data type choice from commit dc2123400.

2023-12-27 Thread Tom Lane
Fix another incorrect data type choice from commit dc2123400. add_file_to_manifest declared its mtime argument as pg_time_t, apparently on the principle that copy-and-paste from the backend is fine. However, the callers are passing struct stat's st_mtime field which is plain time_t, and add_file_

pgsql: Fix incorrect format placeholders

2023-12-27 Thread Peter Eisentraut
Fix incorrect format placeholders Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/390408ec08d338f36798ec063f81c5098596f8da Modified Files -- src/backend/replication/syncrep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: Fix a warning in Perl test code

2023-12-27 Thread Peter Eisentraut
Fix a warning in Perl test code The code was passing a scalar argument to node->restart(), but it was expecting a hash, which causes a warning from Perl ("Odd number of elements in hash assignment"). But the node->restart() function doesn't take a mode argument anyway. This was probably copied fr

pgsql: Fix incorrect data type choices in some read and write calls.

2023-12-27 Thread Tom Lane
Fix incorrect data type choices in some read and write calls. Recently-introduced code in reconstruct.c was using "unsigned" to store the result of read(), pg_pread(), or write(). This is completely bogus: it breaks subsequent tests for the result being negative, as we're being reminded of by a c

pgsql: Initialize variable to placate compiler.

2023-12-27 Thread Robert Haas
Initialize variable to placate compiler. I don't think there's a real problem here, because if we reach the loop over 'tles' then we will either find at least one TimeLineHistoryEntry such that oldest_segno != 0, in which case unsummarized_lsn will be initialized, or else unsummarized_tli will rem

pgsql: Improvements and fixes for e0b1ee17dc

2023-12-27 Thread Alexander Korotkov
Improvements and fixes for e0b1ee17dc e0b1ee17dc introduced optimization for matching B-tree scan keys required for the directional scan. However, it incorrectly assumed that all keys required for opposite direction scan are satisfied by _bt_first(). It has been illustrated that with multiple sc

pgsql: Remove BTScanOpaqueData.firstPage

2023-12-27 Thread Alexander Korotkov
Remove BTScanOpaqueData.firstPage It's not necessary to keep the firstPage flag as a field of BTScanOpaqueData. This commit makes it an argument of the _bt_readpage() function. We can easily distinguish first-time and repeated calls (within the scan) of this function. Reported-by: Peter Geoghega

pgsql: pg_stat_statements: Add test coverage for pg_stat_statements_res

2023-12-27 Thread Peter Eisentraut
pg_stat_statements: Add test coverage for pg_stat_statements_reset_1_7 Run pg_stat_statements_reset() once while the appropriate extension version is installed. Reviewed-by: Michael Paquier Discussion: https://www.postgresql.org/message-id/flat/40d1e4f2-835f-448f-a541-8ff5db75b...@eisentraut.or

pgsql: pg_stat_statements: Add test coverage for pg_stat_statements_1_8

2023-12-27 Thread Peter Eisentraut
pg_stat_statements: Add test coverage for pg_stat_statements_1_8() This requires reading pg_stat_statements at least once while the 1.8 version of the extension is installed. Reviewed-by: Michael Paquier Discussion: https://www.postgresql.org/message-id/flat/40d1e4f2-835f-448f-a541-8ff5db75b...