pgsql: Add XML ID attributes to create_publication.sgml.

2023-03-30 Thread Amit Kapila
Add XML ID attributes to create_publication.sgml. This commit adds XML ID attributes to all varlistentries in create_publication.sgml. This allows us to include links to refer to publication options, making documents more readable. Author: Kuroda Hayato Reviewed-by: Peter Smith, Amit Kapila Discu

pgsql: Bump PGSTAT_FILE_FORMAT_ID, omitted in 8aaa04b32d7

2023-03-30 Thread Andres Freund
Bump PGSTAT_FILE_FORMAT_ID, omitted in 8aaa04b32d7 I forgot to do so in the referenced commit. While the consequences of omitting the version change are likely to be harmless (besides discarding stats, as a PGSTAT_FILE_FORMAT_ID bump also does), it still seems worth doing. Branch -- master D

pgsql: Track shared buffer hits in pg_stat_io

2023-03-30 Thread Andres Freund
Track shared buffer hits in pg_stat_io Among other things, this should make it easier to calculate a useful cache hit ratio by excluding buffer reads via buffer access strategies. As buffer access strategies reuse buffers (and thus evict the prior buffer contents), it is normal to see reads on rep

pgsql: Fix List memory issue in transformColumnDefinition

2023-03-30 Thread David Rowley
Fix List memory issue in transformColumnDefinition When calling generateSerialExtraStmts(), we would pass in the constraint->options. In some cases, generateSerialExtraStmts() would modify the referenced List to remove elements from it, but doing so is invalid without assigning the list back to a

pgsql: Fix List memory issue in transformColumnDefinition

2023-03-30 Thread David Rowley
Fix List memory issue in transformColumnDefinition When calling generateSerialExtraStmts(), we would pass in the constraint->options. In some cases, generateSerialExtraStmts() would modify the referenced List to remove elements from it, but doing so is invalid without assigning the list back to a

pgsql: Fix List memory issue in transformColumnDefinition

2023-03-30 Thread David Rowley
Fix List memory issue in transformColumnDefinition When calling generateSerialExtraStmts(), we would pass in the constraint->options. In some cases, generateSerialExtraStmts() would modify the referenced List to remove elements from it, but doing so is invalid without assigning the list back to a

pgsql: Fix List memory issue in transformColumnDefinition

2023-03-30 Thread David Rowley
Fix List memory issue in transformColumnDefinition When calling generateSerialExtraStmts(), we would pass in the constraint->options. In some cases, generateSerialExtraStmts() would modify the referenced List to remove elements from it, but doing so is invalid without assigning the list back to a

pgsql: Fix List memory issue in transformColumnDefinition

2023-03-30 Thread David Rowley
Fix List memory issue in transformColumnDefinition When calling generateSerialExtraStmts(), we would pass in the constraint->options. In some cases, generateSerialExtraStmts() would modify the referenced List to remove elements from it, but doing so is invalid without assigning the list back to a

pgsql: Fix List memory issue in transformColumnDefinition

2023-03-30 Thread David Rowley
Fix List memory issue in transformColumnDefinition When calling generateSerialExtraStmts(), we would pass in the constraint->options. In some cases, generateSerialExtraStmts() would modify the referenced List to remove elements from it, but doing so is invalid without assigning the list back to a

pgsql: Parallel Hash Full Join.

2023-03-30 Thread Thomas Munro
Parallel Hash Full Join. Full and right outer joins were not supported in the initial implementation of Parallel Hash Join because of deadlock hazards (see discussion). Therefore FULL JOIN inhibited parallelism, as the other join strategies can't do that in parallel either. Add a new PHJ phase P

pgsql: pg_stat_wal: Accumulate time as instr_time instead of microsecon

2023-03-30 Thread Andres Freund
pg_stat_wal: Accumulate time as instr_time instead of microseconds In instr_time.h it is stated that: * When summing multiple measurements, it's recommended to leave the * running sum in instr_time form (ie, use INSTR_TIME_ADD or * INSTR_TIME_ACCUM_DIFF) and convert to a result format only at the

pgsql: Show record information in pg_get_wal_block_info.

2023-03-30 Thread Peter Geoghegan
Show record information in pg_get_wal_block_info. Expand the output parameters in pg_walinspect's pg_get_wal_block_info function to return additional information that was previously only available from pg_walinspect's pg_get_wal_records_info function. Some of the details are attributed to individ

pgsql: Simplify transformJsonAggConstructor() API

2023-03-30 Thread Alvaro Herrera
Simplify transformJsonAggConstructor() API There's no need for callers to pass aggregate names so that the function can resolve them to OIDs, when callers can just pass aggregate OIDs directly to begin with. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/63cc20205c

pgsql: Fix inconsistencies and style issues in new SQL/JSON code

2023-03-30 Thread Alvaro Herrera
Fix inconsistencies and style issues in new SQL/JSON code Reported by Alexander Lakhin. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/60966f56c3e4db9f9bdff485371ef3a50d53431f Modified

pgsql: Fix setrefs.c code for adjusting partPruneInfos

2023-03-30 Thread Alvaro Herrera
Fix setrefs.c code for adjusting partPruneInfos We were transferring partPruneInfos from PlannerInfo into PlannerGlobal wrong, essentially relying on all of them being transferred, and adjusting their list indexes based on that. But apparently it's possible that some of them are skipped, so that

pgsql: bufmgr: Fix undefined behaviour with, unrealistically, large tem

2023-03-30 Thread Andres Freund
bufmgr: Fix undefined behaviour with, unrealistically, large temp_buffers Quoting Melanie: > Since if buffer is INT_MAX, then the -(buffer + 1) version invokes > undefined behavior while the -buffer - 1 version doesn't. All other places were already using the correct version. I (Andres), copied t

pgsql: Fix format code in fd.c debugging infrastructure

2023-03-30 Thread Andres Freund
Fix format code in fd.c debugging infrastructure These were not sufficiently adjusted in 2d4f1ba6cfc. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f9054b7a7cd47b93d6a59f15994ce72c51fe1e04 Modified Files -- src/backend/storage/file/fd.c | 6 +++--- 1 f

pgsql: Clean up role created in new subscription test.

2023-03-30 Thread Tom Lane
Clean up role created in new subscription test. This oversight broke repeated runs of "make installcheck". Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e9d202a1499d6a70e80d080fcdba07fe6707845d Modified Files -- src/test/regress/expected/subscription.

pgsql: Fix documentation build for c3afe8cf5a1e465bd71e48e4bc717f5bfdc7

2023-03-30 Thread Robert Haas
Fix documentation build for c3afe8cf5a1e465bd71e48e4bc717f5bfdc7a7d6. This documentation hunk was intended to be part of that commit, but I goofed. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9c487efe355692a4a219df1a1e5330ac02079bf8 Modified Files -

pgsql: Add new predefined role pg_create_subscription.

2023-03-30 Thread Robert Haas
Add new predefined role pg_create_subscription. This role can be granted to non-superusers to allow them to issue CREATE SUBSCRIPTION. The non-superuser must additionally have CREATE permissions on the database in which the subscription is to be created. Most forms of ALTER SUBSCRIPTION, includin

pgsql: Avoid overflow in width_bucket_float8().

2023-03-30 Thread Tom Lane
Avoid overflow in width_bucket_float8(). The original coding of this function paid little attention to the possibility of overflow. There were actually three different hazards: 1. The range from bound1 to bound2 could exceed DBL_MAX, which on IEEE-compliant machines produces +Infinity in the sub

pgsql: Fix pointer cast for seed calculation on 32-bit systems

2023-03-30 Thread Daniel Gustafsson
Fix pointer cast for seed calculation on 32-bit systems The fallback seed for when pg_strong_random cannot generate a high quality seed mixes in the address of the conn object, but the cast failed to take the word size into consideration. Fix by casting to a uintptr_t instead. The seed calculation