postgresql/src
Tom Lane b14953932d Revise FDW planning API, again.
Further reflection shows that a single callback isn't very workable if we
desire to let FDWs generate multiple Paths, because that forces the FDW to
do all work necessary to generate a valid Plan node for each Path.  Instead
split the former PlanForeignScan API into three steps: GetForeignRelSize,
GetForeignPaths, GetForeignPlan.  We had already bit the bullet of breaking
the 9.1 FDW API for 9.2, so this shouldn't cause very much additional pain,
and it's substantially more flexible for complex FDWs.

Add an fdw_private field to RelOptInfo so that the new functions can save
state there rather than possibly having to recalculate information two or
three times.

In addition, we'd not thought through what would be needed to allow an FDW
to set up subexpressions of its choice for runtime execution.  We could
treat ForeignScan.fdw_private as an executable expression but that seems
likely to break existing FDWs unnecessarily (in particular, it would
restrict the set of node types allowable in fdw_private to those supported
by expression_tree_walker).  Instead, invent a separate field fdw_exprs
which will receive the postprocessing appropriate for expression trees.
(One field is enough since it can be a list of expressions; also, we assume
the corresponding expression state tree(s) will be held within fdw_state,
so we don't need to add anything to ForeignScanState.)

Per review of Hanada Shigeru's pgsql_fdw patch.  We may need to tweak this
further as we continue to work on that patch, but to me it feels a lot
closer to being right now.
2012-03-09 12:49:25 -05:00
..
backend Revise FDW planning API, again. 2012-03-09 12:49:25 -05:00
bin psql: Remove useless code 2012-03-08 23:15:03 +02:00
include Revise FDW planning API, again. 2012-03-09 12:49:25 -05:00
interfaces ecpg: Fix off-by-one error in memory copying 2012-03-08 22:29:01 +02:00
makefiles Add pg_upgrade test suite 2011-11-27 22:42:32 +02:00
pl Fix I/O-conversion-related memory leaks in plpgsql. 2012-02-11 18:06:24 -05:00
port Move CRC tables to libpgport, and provide them in a separate include file. 2012-02-28 19:53:39 -05:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Add isolation test to check-world and installcheck-world 2012-03-05 20:19:20 +02:00
timezone Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
tools Fix MSVC builds for previous patch's addition of a src/port file. 2012-02-29 00:24:01 -05:00
tutorial Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in ecpg: Improve test building 2012-02-02 20:33:29 +02:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:23 -04:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
nls-global.mk Sort compendium lists for msgmerge 2011-12-27 20:22:51 +02:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00