postgres.git / summary / log / commit / refs
commit 015f4c9fc35f91a1ab46bafab05a3686cfe09d46
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri Oct 23 14:29:45 2026 +0000
First released in: 18.7, 19.0
Remove faulty Asserts added by 1999fe227.
I added these assertions in an attempt to show that setting
ret_old_alias/ret_new_alias in set_deparse_plan() fully covered
all the parts of the plan where RETURNING Vars could be found.
But it emerges that the returningOldAlias/returningNewAlias
fields they are filled from can sometimes be NULL themselves,
allowing the asserts to fail. We discussed various ways that
we might adjust the rewriter to prevent that, but the upshot
of the discussion was just to remove the asserts again.
Reported-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Discussion: https://postgr.es/m/CAJTYsWWsORQbyViXmsvT4-NWkjuykkjjk2c+gQtq+vw2PJON-A@mail.gmail.com
Backpatch-through: 18
src/backend/utils/adt/ruleutils.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 128d17390df..9f0653dbfc5 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -7738,15 +7738,9 @@ get_variable(Var *var, int levelsup, bool istoplevel, deparse_context *context)
/* might be returning old/new column value */
if (var->varreturningtype == VAR_RETURNING_OLD)
- {
refname = dpns->ret_old_alias;
- Assert(refname);
- }
else if (var->varreturningtype == VAR_RETURNING_NEW)
- {
refname = dpns->ret_new_alias;
- Assert(refname);
- }
else
refname = (char *) list_nth(dpns->rtable_names, varno - 1);
[parent: 711329a6b9bd]