postgresql/contrib
Etsuro Fujita 7cfdc77023 Disable support for partitionwise joins in problematic cases.
Commit f49842d, which added support for partitionwise joins, built the
child's tlist by applying adjust_appendrel_attrs() to the parent's.  So in
the case where the parent's included a whole-row Var for the parent, the
child's contained a ConvertRowtypeExpr.  To cope with that, that commit
added code to the planner, such as setrefs.c, but some code paths still
assumed that the tlist for a scan (or join) rel would only include Vars
and PlaceHolderVars, which was true before that commit, causing errors:

* When creating an explicit sort node for an input path for a mergejoin
  path for a child join, prepare_sort_from_pathkeys() threw the 'could not
  find pathkey item to sort' error.
* When deparsing a relation participating in a pushed down child join as a
  subquery in contrib/postgres_fdw, get_relation_column_alias_ids() threw
  the 'unexpected expression in subquery output' error.
* When performing set_plan_references() on a local join plan generated by
  contrib/postgres_fdw for EvalPlanQual support for a pushed down child
  join, fix_join_expr() threw the 'variable not found in subplan target
  lists' error.

To fix these, two approaches have been proposed: one by Ashutosh Bapat and
one by me.  While the former keeps building the child's tlist with a
ConvertRowtypeExpr, the latter builds it with a whole-row Var for the
child not to violate the planner assumption, and tries to fix it up later,
But both approaches need more work, so refuse to generate partitionwise
join paths when whole-row Vars are involved, instead.  We don't need to
handle ConvertRowtypeExprs in the child's tlists for now, so this commit
also removes the changes to the planner.

Previously, partitionwise join computed attr_needed data for each child
separately, and built the child join's tlist using that data, which also
required an extra step for adding PlaceHolderVars to that tlist, but it
would be more efficient to build it from the parent join's tlist through
the adjust_appendrel_attrs() transformation.  So this commit builds that
list that way, and simplifies build_joinrel_tlist() and placeholder.c as
well as part of set_append_rel_size() to basically what they were before
partitionwise join went in.

Back-patch to PG11 where partitionwise join was introduced.

Report by Rajkumar Raghuwanshi.  Analysis by Ashutosh Bapat, who also
provided some of regression tests.  Patch by me, reviewed by Robert Haas.

Discussion: https://postgr.es/m/CAKcux6ktu-8tefLWtQuuZBYFaZA83vUzuRd7c1YHC-yEWyYFpg@mail.gmail.com
2018-08-31 20:34:06 +09:00
..
adminpack adminpack: Revoke EXECUTE on pg_logfile_rotate() 2018-05-07 10:10:33 -04:00
amcheck Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
auth_delay Update copyright for 2018 2018-01-02 23:30:12 -05:00
auto_explain Provide a log_level setting for auto_explain 2018-07-31 08:03:57 -04:00
bloom Fix misc typos, mostly in comments. 2018-07-18 16:17:32 +03:00
btree_gin Provide separate header file for built-in float types 2018-07-29 03:30:48 +02:00
btree_gist Provide separate header file for built-in float types 2018-07-29 03:30:48 +02:00
citext Fix hashjoin costing mistake introduced with inner_unique optimization. 2018-07-14 11:59:12 -04:00
cube Provide for contrib and pgxs modules to install include files. 2018-07-31 20:07:39 +01:00
dblink Deduplicate "invalid input syntax" messages for various types. 2018-07-22 14:58:01 -07:00
dict_int Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
dict_xsyn Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
earthdistance Fix earthdistance test suite function name typo. 2018-07-29 12:02:07 -07:00
file_fdw Allow insert and update tuple routing and COPY for foreign tables. 2018-04-06 19:22:03 -04:00
fuzzystrmatch Replace search.cpan.org with metacpan.org 2018-06-29 22:02:20 +09:00
hstore Provide for contrib and pgxs modules to install include files. 2018-07-31 20:07:39 +01:00
hstore_plperl Fix contrib/hstore_plperl to look through scalar refs. 2018-06-18 15:55:06 -04:00
hstore_plpython Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
intagg Schema-qualify some references to regprocedure. 2016-06-10 10:41:58 -04:00
intarray Fix yet more problems with incorrectly-constructed zero-length arrays. 2018-07-09 14:28:04 -04:00
isn Provide for contrib and pgxs modules to install include files. 2018-07-31 20:07:39 +01:00
jsonb_plperl Rethink how to get float.h in old Windows API for isnan/isinf 2018-07-11 09:11:48 -04:00
jsonb_plpython Fix memory leak in PLySequence_ToJsonbValue() 2018-06-15 15:01:46 +03:00
lo lo: Add test suite 2017-09-14 22:22:59 -04:00
ltree Provide for contrib and pgxs modules to install include files. 2018-07-31 20:07:39 +01:00
ltree_plpython Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
oid2name Rework option set of oid2name 2018-08-28 21:33:32 +09:00
pageinspect Make error message of pageinspect more consistent for raw page inputs 2018-07-29 23:50:35 +09:00
passwordcheck Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_buffercache Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pg_freespacemap Default monitoring roles 2017-03-30 14:18:53 -04:00
pg_prewarm Avoid portability issues in autoprewarm.c. 2018-05-03 12:50:34 -04:00
pg_standby pg_standby: Remove code for .backup files 2018-07-01 15:10:08 +02:00
pg_stat_statements Make more consistent some error messages for file-related operations 2018-07-23 09:19:12 +09:00
pg_trgm Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
pg_visibility Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgcrypto Make capitalization of term "OpenSSL" more consistent 2018-06-29 09:45:44 +09:00
pgrowlocks Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
pgstattuple pgstatindex, pageinspect: handle partitioned indexes 2018-05-09 14:22:59 -03:00
postgres_fdw Disable support for partitionwise joins in problematic cases. 2018-08-31 20:34:06 +09:00
seg Provide for contrib and pgxs modules to install include files. 2018-07-31 20:07:39 +01:00
sepgsql Update sepgsql regression test output for getObjectDescription() changes. 2018-05-24 16:11:25 -04:00
spi Hand code string to integer conversion for performance. 2018-07-22 14:58:23 -07:00
sslinfo Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
start-scripts Remove contrib/start-scripts/osx/. 2017-11-17 12:53:20 -05:00
tablefunc Update copyright for 2018 2018-01-02 23:30:12 -05:00
tcn Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
test_decoding Fix logical replication slot initialization 2018-08-01 17:47:15 -04:00
tsm_system_rows Update copyright for 2018 2018-01-02 23:30:12 -05:00
tsm_system_time Rethink how to get float.h in old Windows API for isnan/isinf 2018-07-11 09:11:48 -04:00
unaccent Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
uuid-ossp Update copyright for 2018 2018-01-02 23:30:12 -05:00
vacuumlo Rework option set of vacuumlo 2018-08-28 21:42:45 +09:00
xml2 Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
contrib-global.mk Respect TEMP_CONFIG when pg_regress_check and friends are called 2016-02-27 12:28:21 -05:00
Makefile Transforms for jsonb to PL/Perl 2018-04-03 09:47:18 -04:00
README Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.