Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 332fdbe

Browse files
committed
postgres_fdw: Promote an Assert() to elog().
Andreas Seltenreich reports that it is possible for a PlaceHolderVar to creep into this tlist, and I fear that even after that's fixed we might have other, similar bugs in this area either now or in the future. There's a lot of action-at-a-distance here, because the validity of this assertion depends on core planner behavior; so, let's use elog() to make sure we catch this even in non-assert builds, rather than just crashing.
1 parent 783cb6e commit 332fdbe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contrib/postgres_fdw/deparse.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1112,8 +1112,10 @@ deparseExplicitTargetList(List *tlist, List **retrieved_attrs,
11121112
/* Extract expression if TargetEntry node */
11131113
Assert(IsA(tle, TargetEntry));
11141114
var = (Var *) tle->expr;
1115+
11151116
/* We expect only Var nodes here */
1116-
Assert(IsA(var, Var));
1117+
if (!IsA(var, Var))
1118+
elog(ERROR, "non-Var not expected in target list");
11171119

11181120
if (i > 0)
11191121
appendStringInfoString(buf, ", ");

0 commit comments

Comments
 (0)