pgsql: Remove unnecessary array object_classes[] in dependency.c

2024-02-26 Thread Michael Paquier
Remove unnecessary array object_classes[] in dependency.c object_classes[] provided unnecessary indirection between catalog OIDs and the enum ObjectClass when calling add_object_address(). This array has been originally introduced in 30ec31604d5 and was useful because not all relation OIDs were

pgsql: Adjust memory allocation functions to allow sibling calls

2024-02-26 Thread David Rowley
Adjust memory allocation functions to allow sibling calls Many modern compilers are able to optimize function calls to functions where the parameters of the called function match a leading subset of the calling function's parameters. If there are no instructions in the calling function after the

pgsql: Fix comment thinko in sequence.c

2024-02-26 Thread Michael Paquier
Fix comment thinko in sequence.c One comment mentioned indexes, but the relation opened should be sequences. Reported-by: Matthias van de Meent Discussion: https://postgr.es/m/CAEze2WiMGNG9XK3NSUen-5BARhCnP=u=fxnf8pvpl2qdkeo...@mail.gmail.com Branch -- master Details ---

pgsql: Use NULL instead of 0 for 'arg' argument in dshash_create() call

2024-02-26 Thread Nathan Bossart
Use NULL instead of 0 for 'arg' argument in dshash_create() calls. A couple of dshash_create() callers provide 0 for the 'void *arg' argument, which might give readers the incorrect impression that this is some sort of "flags" parameter. Reviewed-by: Andy Fan Discussion:

pgsql: Add helper functions for dshash tables with string keys.

2024-02-26 Thread Nathan Bossart
Add helper functions for dshash tables with string keys. Presently, string keys are not well-supported for dshash tables. The dshash code always copies key_size bytes into new entries' keys, and dshash.h only provides compare and hash functions that forward to memcmp() and tag_hash(), both of

pgsql: Revise MERGE documentation

2024-02-26 Thread Alvaro Herrera
Revise MERGE documentation Add a note about the additional privileges required after the fix in 4989ce72644b (wording per Tom Lane); also change marked-up mentions of "target_table_name" to be simply "the target table" or the like. Also, note that "join_condition" is scouted for requisite

pgsql: Revise MERGE documentation

2024-02-26 Thread Alvaro Herrera
Revise MERGE documentation Add a note about the additional privileges required after the fix in 4989ce72644b (wording per Tom Lane); also change marked-up mentions of "target_table_name" to be simply "the target table" or the like. Also, note that "join_condition" is scouted for requisite

pgsql: Revise MERGE documentation

2024-02-26 Thread Alvaro Herrera
Revise MERGE documentation Add a note about the additional privileges required after the fix in 4989ce72644b (wording per Tom Lane); also change marked-up mentions of "target_table_name" to be simply "the target table" or the like. Also, note that "join_condition" is scouted for requisite

pgsql: slru.c: Reduce scope of variables in 'for' blocks

2024-02-26 Thread Alvaro Herrera
slru.c: Reduce scope of variables in 'for' blocks Pretty boring. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/5f79cb7629a4ce6321f509694ebf475a931608b6 Modified Files -- src/backend/access/transam/slru.c | 33 +++-- 1 file

pgsql: Group more closely cache updates for backends in sequence.c

2024-02-26 Thread Michael Paquier
Group more closely cache updates for backends in sequence.c Information of sequences is cached for each backend for currval() and nextval(), and the update of some cached information was mixed in the middle of computations based on the other properties of a sequence, for the increment value in