pgsql: Remove references to backup_fs_hot() in Cluster.pm

2024-03-17 Thread Michael Paquier
Remove references to backup_fs_hot() in Cluster.pm This routine has been removed in 39969e2a1e4d with the exclusive backup mode but there were still references to it. Issue noticed while working on 071e3ad59d6f. Branch -- master Details ---

pgsql: Initialize variables to placate compiler.

2024-03-17 Thread Nathan Bossart
Initialize variables to placate compiler. Since commit 012460ee93, some compilers have been warning that a couple of variables may be used uninitialized. There doesn't appear to be any actual risk, so let's just initialize these variables to 0 to silence the compiler warnings. Discussion:

pgsql: Support json_errdetail in FRONTEND code

2024-03-17 Thread Daniel Gustafsson
Support json_errdetail in FRONTEND code Allocate memory for the error message inside memory owned by the JsonLexContext and move responsibility away from the caller for freeing it. This means that we can partially revert b44669b2ca as this is now safe to use in FRONTEND code. The motivation for

pgsql: Mark hash_corrupted() as pg_attribute_noreturn.

2024-03-17 Thread Tom Lane
Mark hash_corrupted() as pg_attribute_noreturn. Coverity started complaining about this after cc5ef90ed. The code's not really different from before, but might as well clarify its intent. Branch -- master Details ---

pgsql: Fix PDF doc generation.

2024-03-17 Thread Dean Rasheed
Fix PDF doc generation. Commit c649fa24a4 broke PDF generation, due to a misplaced id attribute. Per buildfarm member crake. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7eb9a8201890f3b208fd4c109a5b08bf139b692a Modified Files --

pgsql: Add RETURNING support to MERGE.

2024-03-17 Thread Dean Rasheed
Add RETURNING support to MERGE. This allows a RETURNING clause to be appended to a MERGE query, to return values based on each row inserted, updated, or deleted. As with plain INSERT, UPDATE, and DELETE commands, the returned values are based on the new contents of the target table for INSERT and

pgsql: Add attstattarget to FormExtraData_pg_attribute

2024-03-17 Thread Peter Eisentraut
Add attstattarget to FormExtraData_pg_attribute This allows setting attstattarget when a relation is created. We make use of this by having index_concurrently_create_copy() copy over the attstattarget values when the new index is created, instead of having index_concurrently_swap() fix it up

pgsql: Make stxstattarget nullable

2024-03-17 Thread Peter Eisentraut
Make stxstattarget nullable To match attstattarget change (commit 4f622503d6d). The logic inside CreateStatistics() is clarified a bit compared to that previous patch, and so here we also update ATExecSetStatistics() to match. Reviewed-by: Tomas Vondra Discussion:

pgsql: Generalize handling of nullable pg_attribute columns in DDL

2024-03-17 Thread Peter Eisentraut
Generalize handling of nullable pg_attribute columns in DDL DDL code uses tuple descriptors to pass around pg_attribute values during table and index creation. But tuple descriptors don't include the variable-length/nullable columns of pg_attribute, so they have to be handled separately. Right

pgsql: Fix EXPLAIN output for subplans in MERGE.

2024-03-17 Thread Dean Rasheed
Fix EXPLAIN output for subplans in MERGE. Given a subplan in a MERGE query, EXPLAIN would sometimes fail to properly display expressions involving Params referencing variables in other parts of the plan tree. This would affect subplans outside the topmost join plan node, for which expansion of

pgsql: Fix EXPLAIN output for subplans in MERGE.

2024-03-17 Thread Dean Rasheed
Fix EXPLAIN output for subplans in MERGE. Given a subplan in a MERGE query, EXPLAIN would sometimes fail to properly display expressions involving Params referencing variables in other parts of the plan tree. This would affect subplans outside the topmost join plan node, for which expansion of

pgsql: Fix EXPLAIN output for subplans in MERGE.

2024-03-17 Thread Dean Rasheed
Fix EXPLAIN output for subplans in MERGE. Given a subplan in a MERGE query, EXPLAIN would sometimes fail to properly display expressions involving Params referencing variables in other parts of the plan tree. This would affect subplans outside the topmost join plan node, for which expansion of