Skip to content

Commit 8cc8695

Browse files
committed
Merge branch 'master' into xtm
2 parents 01f1cc0 + d435542 commit 8cc8695

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2952
-906
lines changed

contrib/file_fdw/file_fdw.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,8 @@ fileGetForeignPlan(PlannerInfo *root,
563563
scan_relid,
564564
NIL, /* no expressions to evaluate */
565565
best_path->fdw_private,
566-
NIL /* no custom tlist */ );
566+
NIL, /* no custom tlist */
567+
NIL /* no remote quals */ );
567568
}
568569

569570
/*

contrib/postgres_fdw/postgres_fdw.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ postgresGetForeignPlan(PlannerInfo *root,
749749
Index scan_relid = baserel->relid;
750750
List *fdw_private;
751751
List *remote_conds = NIL;
752+
List *remote_exprs = NIL;
752753
List *local_exprs = NIL;
753754
List *params_list = NIL;
754755
List *retrieved_attrs;
@@ -770,8 +771,8 @@ postgresGetForeignPlan(PlannerInfo *root,
770771
*
771772
* This code must match "extract_actual_clauses(scan_clauses, false)"
772773
* except for the additional decision about remote versus local execution.
773-
* Note however that we only strip the RestrictInfo nodes from the
774-
* local_exprs list, since appendWhereClause expects a list of
774+
* Note however that we don't strip the RestrictInfo nodes from the
775+
* remote_conds list, since appendWhereClause expects a list of
775776
* RestrictInfos.
776777
*/
777778
foreach(lc, scan_clauses)
@@ -785,11 +786,17 @@ postgresGetForeignPlan(PlannerInfo *root,
785786
continue;
786787

787788
if (list_member_ptr(fpinfo->remote_conds, rinfo))
789+
{
788790
remote_conds = lappend(remote_conds, rinfo);
791+
remote_exprs = lappend(remote_exprs, rinfo->clause);
792+
}
789793
else if (list_member_ptr(fpinfo->local_conds, rinfo))
790794
local_exprs = lappend(local_exprs, rinfo->clause);
791795
else if (is_foreign_expr(root, baserel, rinfo->clause))
796+
{
792797
remote_conds = lappend(remote_conds, rinfo);
798+
remote_exprs = lappend(remote_exprs, rinfo->clause);
799+
}
793800
else
794801
local_exprs = lappend(local_exprs, rinfo->clause);
795802
}
@@ -875,7 +882,8 @@ postgresGetForeignPlan(PlannerInfo *root,
875882
scan_relid,
876883
params_list,
877884
fdw_private,
878-
NIL /* no custom tlist */ );
885+
NIL, /* no custom tlist */
886+
remote_exprs);
879887
}
880888

881889
/*

doc/src/sgml/config.sgml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,27 +2417,6 @@ include_dir 'conf.d'
24172417
<title>Checkpoints</title>
24182418

24192419
<variablelist>
2420-
<varlistentry id="guc-max-wal-size" xreflabel="max_wal_size">
2421-
<term><varname>max_wal_size</varname> (<type>integer</type>)
2422-
<indexterm>
2423-
<primary><varname>max_wal_size</> configuration parameter</primary>
2424-
</indexterm>
2425-
</term>
2426-
<listitem>
2427-
<para>
2428-
Maximum size to let the WAL grow to between automatic WAL
2429-
checkpoints. This is a soft limit; WAL size can exceed
2430-
<varname>max_wal_size</> under special circumstances, like
2431-
under heavy load, a failing <varname>archive_command</>, or a high
2432-
<varname>wal_keep_segments</> setting. The default is 1 GB.
2433-
Increasing this parameter can increase the amount of time needed for
2434-
crash recovery.
2435-
This parameter can only be set in the <filename>postgresql.conf</>
2436-
file or on the server command line.
2437-
</para>
2438-
</listitem>
2439-
</varlistentry>
2440-
24412420
<varlistentry id="guc-checkpoint-timeout" xreflabel="checkpoint_timeout">
24422421
<term><varname>checkpoint_timeout</varname> (<type>integer</type>)
24432422
<indexterm>
@@ -2494,6 +2473,27 @@ include_dir 'conf.d'
24942473
</listitem>
24952474
</varlistentry>
24962475

2476+
<varlistentry id="guc-max-wal-size" xreflabel="max_wal_size">
2477+
<term><varname>max_wal_size</varname> (<type>integer</type>)
2478+
<indexterm>
2479+
<primary><varname>max_wal_size</> configuration parameter</primary>
2480+
</indexterm>
2481+
</term>
2482+
<listitem>
2483+
<para>
2484+
Maximum size to let the WAL grow to between automatic WAL
2485+
checkpoints. This is a soft limit; WAL size can exceed
2486+
<varname>max_wal_size</> under special circumstances, like
2487+
under heavy load, a failing <varname>archive_command</>, or a high
2488+
<varname>wal_keep_segments</> setting. The default is 1 GB.
2489+
Increasing this parameter can increase the amount of time needed for
2490+
crash recovery.
2491+
This parameter can only be set in the <filename>postgresql.conf</>
2492+
file or on the server command line.
2493+
</para>
2494+
</listitem>
2495+
</varlistentry>
2496+
24972497
<varlistentry id="guc-min-wal-size" xreflabel="min_wal_size">
24982498
<term><varname>min_wal_size</varname> (<type>integer</type>)
24992499
<indexterm>

doc/src/sgml/fdwhandler.sgml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,15 @@ GetForeignServerByName(const char *name, bool missing_ok);
11351135
evaluation of the <structfield>fdw_exprs</> expression tree.
11361136
</para>
11371137

1138+
<para>
1139+
Any clauses removed from the plan node's qual list must instead be added
1140+
to <literal>fdw_recheck_quals</> in order to ensure correct behavior
1141+
at the <literal>READ COMMITTED</> isolation level. When a concurrent
1142+
update occurs for some other table involved in the query, the executor
1143+
may need to verify that all of the original quals are still satisfied for
1144+
the tuple, possibly against a different set of parameter values.
1145+
</para>
1146+
11381147
<para>
11391148
Another <structname>ForeignScan</> field that can be filled by FDWs
11401149
is <structfield>fdw_scan_tlist</>, which describes the tuples returned by

0 commit comments

Comments
 (0)