PG_PATCH_set_nestloop_off_issue_fix.patch
application/octet-stream
Filename: PG_PATCH_set_nestloop_off_issue_fix.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| contrib/postgres_fdw/postgres_fdw.c | 2 | 2 |
| src/backend/optimizer/util/restrictinfo.c | 19 | 0 |
| src/include/optimizer/restrictinfo.h | 1 | 0 |
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index f5926ab..a67e7a1 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -1317,8 +1317,8 @@ postgresGetForeignPlan(PlannerInfo *root,
* Instead we get the conditions to apply from the fdw_private
* structure.
*/
- remote_exprs = extract_actual_clauses(fpinfo->remote_conds, false);
- local_exprs = extract_actual_clauses(fpinfo->local_conds, false);
+ remote_exprs = extract_the_clauses(fpinfo->remote_conds);
+ local_exprs = extract_the_clauses(fpinfo->local_conds);
/*
* We leave fdw_recheck_quals empty in this case, since we never need
diff --git a/src/backend/optimizer/util/restrictinfo.c b/src/backend/optimizer/util/restrictinfo.c
index c44bd2f..a48e366 100644
--- a/src/backend/optimizer/util/restrictinfo.c
+++ b/src/backend/optimizer/util/restrictinfo.c
@@ -479,6 +479,25 @@ extract_actual_clauses(List *restrictinfo_list,
}
/*
+ * extract_the_clauses
+ *
+ * Extract bare clauses from 'restrictinfo_list'
+ */
+List *
+extract_the_clauses(List *restrictinfo_list)
+{
+ List *result = NIL;
+ ListCell *l;
+
+ foreach(l, restrictinfo_list)
+ {
+ RestrictInfo *rinfo = lfirst_node(RestrictInfo, l);
+ result = lappend(result, rinfo->clause);
+ }
+ return result;
+}
+
+/*
* extract_actual_join_clauses
*
* Extract bare clauses from 'restrictinfo_list', separating those that
diff --git a/src/include/optimizer/restrictinfo.h b/src/include/optimizer/restrictinfo.h
index c9e3077..e319bf4 100644
--- a/src/include/optimizer/restrictinfo.h
+++ b/src/include/optimizer/restrictinfo.h
@@ -35,6 +35,7 @@ extern bool restriction_is_securely_promotable(RestrictInfo *restrictinfo,
extern List *get_actual_clauses(List *restrictinfo_list);
extern List *extract_actual_clauses(List *restrictinfo_list,
bool pseudoconstant);
+extern List *extract_the_clauses(List *restrictinfo_list);
extern void extract_actual_join_clauses(List *restrictinfo_list,
Relids joinrelids,
List **joinquals,