pgsql: Remove references to backup_fs_hot() in Cluster.pm
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 --- https://git.postgresql.org/pg/commitdiff/ca108be72e7abf1f801c8e49dcfff412c0d9 Modified Files -- src/test/perl/PostgreSQL/Test/Cluster.pm | 5 + 1 file changed, 1 insertion(+), 4 deletions(-)
pgsql: Initialize variables to placate compiler.
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: https://postgr.es/m/20240317192927.GA3978212%40nathanxps13 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/949300402bde06699a23f216e26343e3503ba78b Modified Files -- src/backend/commands/statscmds.c | 2 +- src/backend/commands/tablecmds.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
pgsql: Support json_errdetail in FRONTEND code
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 this comes from the OAuth and incremental JSON patchsets but it also adds value on its own. Author: Jacob Champion Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/CAOYmi+mWdTd6ujtyF7MsvXvk7ToLRVG_tYAcaGbQLvf=n4k...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d6607016c738a5ccdd9422f3c11778903a03cdbb Modified Files -- src/bin/pg_verifybackup/t/005_bad_manifest.pl | 3 +- src/common/jsonapi.c | 121 +++--- src/common/parse_manifest.c | 2 +- src/include/common/jsonapi.h | 1 + 4 files changed, 73 insertions(+), 54 deletions(-)
pgsql: Mark hash_corrupted() as pg_attribute_noreturn.
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 --- https://git.postgresql.org/pg/commitdiff/33f13168ccd6e65bf0b3959a7e894449e8b6cb36 Modified Files -- src/backend/utils/hash/dynahash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Fix PDF doc generation.
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 -- doc/src/sgml/func.sgml | 4 ++-- doc/src/sgml/ref/merge.sgml | 17 + 2 files changed, 11 insertions(+), 10 deletions(-)
pgsql: Add RETURNING support to MERGE.
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 UPDATE actions, and on its old contents for DELETE actions. Values from the source relation may also be returned. As with INSERT/UPDATE/DELETE, the output of MERGE ... RETURNING may be used as the source relation for other operations such as WITH queries and COPY commands. Additionally, a special function merge_action() is provided, which returns 'INSERT', 'UPDATE', or 'DELETE', depending on the action executed for each row. The merge_action() function can be used anywhere in the RETURNING list, including in arbitrary expressions and subqueries, but it is an error to use it anywhere outside of a MERGE query's RETURNING list. Dean Rasheed, reviewed by Isaac Morland, Vik Fearing, Alvaro Herrera, Gurjeet Singh, Jian He, Jeff Davis, Merlin Moncure, Peter Eisentraut, and Wolfgang Walther. Discussion: http://postgr.es/m/CAEZATCWePEGQR5LBn-vD6SfeLZafzEm2Qy_L_Oky2=qw2w3...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c649fa24a42ba89bf5460c7110e4fc8eeca65959 Modified Files -- doc/src/sgml/dml.sgml | 22 ++- doc/src/sgml/func.sgml| 79 doc/src/sgml/glossary.sgml| 6 +- doc/src/sgml/plpgsql.sgml | 16 +- doc/src/sgml/queries.sgml | 9 +- doc/src/sgml/ref/copy.sgml| 19 +- doc/src/sgml/ref/merge.sgml | 68 +-- doc/src/sgml/ref/select.sgml | 11 +- doc/src/sgml/rowtypes.sgml| 2 +- doc/src/sgml/spi.sgml | 14 +- doc/src/sgml/xfunc.sgml | 8 +- src/backend/commands/copy.c | 6 - src/backend/commands/copyto.c | 3 +- src/backend/executor/execExpr.c | 13 ++ src/backend/executor/execExprInterp.c | 48 + src/backend/executor/execPartition.c | 8 +- src/backend/executor/functions.c | 9 +- src/backend/executor/nodeModifyTable.c| 202 +-- src/backend/executor/spi.c| 7 +- src/backend/jit/llvm/llvmjit_expr.c | 6 + src/backend/jit/llvm/llvmjit_types.c | 1 + src/backend/nodes/nodeFuncs.c | 17 ++ src/backend/optimizer/plan/subselect.c| 9 +- src/backend/optimizer/util/paramassign.c | 51 + src/backend/parser/analyze.c | 19 +- src/backend/parser/gram.y | 14 +- src/backend/parser/parse_agg.c| 2 + src/backend/parser/parse_cte.c| 10 +- src/backend/parser/parse_expr.c | 34 src/backend/parser/parse_func.c | 1 + src/backend/parser/parse_merge.c | 7 +- src/backend/parser/parse_relation.c | 7 +- src/backend/parser/parse_target.c | 4 + src/backend/rewrite/rewriteHandler.c | 9 +- src/backend/rewrite/rowsecurity.c | 28 ++- src/backend/tcop/utility.c| 3 +- src/backend/utils/adt/ruleutils.c | 14 +- src/bin/psql/common.c | 8 +- src/include/catalog/catversion.h | 2 +- src/include/executor/execExpr.h | 3 + src/include/executor/spi.h| 1 + src/include/nodes/execnodes.h | 3 + src/include/nodes/parsenodes.h| 1 + src/include/nodes/primnodes.h | 21 ++ src/include/optimizer/paramassign.h | 2 + src/include/parser/analyze.h | 2 + src/include/parser/kwlist.h | 1 + src/include/parser/parse_node.h | 3 +- src/pl/plpgsql/src/pl_exec.c | 12 +- src/pl/tcl/pltcl.c| 1 + src/test/regress/expected/merge.out | 266 -- src/test/regress/expected/rowsecurity.out | 32 +++- src/test/regress/expected/rules.out | 16 +- src/test/regress/expected/updatable_views.out | 30 ++- src/test/regress/expected/with.out| 10 + src/test/regress/sql/merge.sql| 169 ++-- src/test/regress/sql/rowsecurity.sql | 21 ++ src/test/regress/sql/rules.sql| 6 +- src/test/regress/sql/updatable_views.sql | 9 +- src/test/regress/sql/with.sql | 8 + src/tools/pgindent/typedefs.list | 1 + 61 files changed, 1198 insertions(+), 216 deletions(-)
pgsql: Add attstattarget to FormExtraData_pg_attribute
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 later. Reviewed-by: Tomas Vondra Discussion: https://www.postgresql.org/message-id/flat/4da8d211-d54d-44b9-9847-f2a9f1184...@eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6a004f1be87d34cfe51acf2fe2552d2b08a79273 Modified Files -- src/backend/catalog/heap.c | 5 +- src/backend/catalog/index.c| 97 +++--- src/backend/catalog/toasting.c | 2 +- src/backend/commands/indexcmds.c | 2 +- src/include/catalog/index.h| 1 + src/include/catalog/pg_attribute.h | 1 + 6 files changed, 36 insertions(+), 72 deletions(-)
pgsql: Make stxstattarget nullable
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: https://www.postgresql.org/message-id/flat/4da8d211-d54d-44b9-9847-f2a9f1184...@eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/012460ee93c304fbc7220e5b55d9d0577fc766ab Modified Files -- doc/src/sgml/catalogs.sgml | 28 ++-- doc/src/sgml/ref/alter_statistics.sgml | 11 src/backend/commands/statscmds.c| 46 +--- src/backend/commands/tablecmds.c| 47 + src/backend/parser/gram.y | 4 +-- src/backend/statistics/extended_stats.c | 4 ++- src/bin/pg_dump/pg_dump.c | 10 --- src/bin/psql/describe.c | 3 ++- src/include/catalog/catversion.h| 2 +- src/include/catalog/pg_statistic_ext.h | 6 ++--- src/include/nodes/parsenodes.h | 2 +- 11 files changed, 93 insertions(+), 70 deletions(-)
pgsql: Generalize handling of nullable pg_attribute columns in DDL
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 now, the attoptions field is handled in a one-off way with a separate argument passed to InsertPgAttributeTuples(). The other affected fields of pg_attribute are right now not needed at relation creation time. The goal of this patch is to generalize this to allow handling additional variable-length/nullable columns of pg_attribute in a similar manner. For that, create a new struct FormExtraData_pg_attribute, which is to be passed around in parallel to the tuple descriptor and optionally supplies the additional columns. Right now, this struct only contains one field for attoptions, so no functionality is actually changed by this. Reviewed-by: Tomas Vondra Discussion: https://www.postgresql.org/message-id/flat/4da8d211-d54d-44b9-9847-f2a9f1184...@eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d939cb2fd612acde0304913213cfbdb01994e682 Modified Files -- src/backend/catalog/heap.c | 21 ++--- src/backend/catalog/index.c| 16 +++- src/include/catalog/heap.h | 2 +- src/include/catalog/pg_attribute.h | 13 + src/tools/pgindent/typedefs.list | 1 + 5 files changed, 44 insertions(+), 9 deletions(-)
pgsql: Fix EXPLAIN output for subplans in MERGE.
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 Params would go via the top-level ModifyTable plan node. The problem was that "inner_tlist" for the ModifyTable node's deparse_namespace was set to the join node's targetlist, but "inner_plan" was set to the ModifyTable node itself, rather than the join node, leading to incorrect results when descending to the referenced variable. Fix and backpatch to v15, where MERGE was introduced. Discussion: https://postgr.es/m/CAEZATCWAv-sZuH%2BwG5xJ-%2BGt7qGNGX8wUQd3XYydMFDKgRB9nw%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/33e729c5148c3a697abc552621b34bdc5fd497ed Modified Files -- src/backend/utils/adt/ruleutils.c | 21 +--- src/test/regress/expected/merge.out | 50 + src/test/regress/sql/merge.sql | 17 + 3 files changed, 79 insertions(+), 9 deletions(-)
pgsql: Fix EXPLAIN output for subplans in MERGE.
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 Params would go via the top-level ModifyTable plan node. The problem was that "inner_tlist" for the ModifyTable node's deparse_namespace was set to the join node's targetlist, but "inner_plan" was set to the ModifyTable node itself, rather than the join node, leading to incorrect results when descending to the referenced variable. Fix and backpatch to v15, where MERGE was introduced. Discussion: https://postgr.es/m/CAEZATCWAv-sZuH%2BwG5xJ-%2BGt7qGNGX8wUQd3XYydMFDKgRB9nw%40mail.gmail.com Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/34c854b93fbec6d7b6dce4ee48c5b7459364a124 Modified Files -- src/backend/utils/adt/ruleutils.c | 21 +--- src/test/regress/expected/merge.out | 50 + src/test/regress/sql/merge.sql | 17 + 3 files changed, 79 insertions(+), 9 deletions(-)
pgsql: Fix EXPLAIN output for subplans in MERGE.
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 Params would go via the top-level ModifyTable plan node. The problem was that "inner_tlist" for the ModifyTable node's deparse_namespace was set to the join node's targetlist, but "inner_plan" was set to the ModifyTable node itself, rather than the join node, leading to incorrect results when descending to the referenced variable. Fix and backpatch to v15, where MERGE was introduced. Discussion: https://postgr.es/m/CAEZATCWAv-sZuH%2BwG5xJ-%2BGt7qGNGX8wUQd3XYydMFDKgRB9nw%40mail.gmail.com Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/89ee14a2f22b2353a6cf9d193c54504b4d3131f5 Modified Files -- src/backend/utils/adt/ruleutils.c | 21 +--- src/test/regress/expected/merge.out | 50 + src/test/regress/sql/merge.sql | 17 + 3 files changed, 79 insertions(+), 9 deletions(-)