1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

Adjust subquery qual pushdown rules so that we can push down a qual

into a UNION that has some type coercions applied to the component
queries, so long as the qual itself does not reference any columns that
have such coercions.  Per example from Jonathan Bartlett 24-Apr-03.
This commit is contained in:
Tom Lane
2003-04-24 23:43:09 +00:00
parent 555fe9dda8
commit 5f677af2da
3 changed files with 89 additions and 34 deletions

View File

@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.92 2003/03/10 03:53:50 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.93 2003/04/24 23:43:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -60,6 +60,7 @@ static List *generate_setop_tlist(List *colTypes, int flag,
static List *generate_append_tlist(List *colTypes, bool flag,
List *input_plans,
List *refnames_tlist);
static bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK);
static Node *adjust_inherited_attrs_mutator(Node *node,
adjust_inherited_attrs_context *context);
static Relids adjust_relid_set(Relids relids, Index oldrelid, Index newrelid);
@ -572,7 +573,7 @@ generate_append_tlist(List *colTypes, bool flag,
* Resjunk columns are ignored if junkOK is true; otherwise presence of
* a resjunk column will always cause a 'false' result.
*/
bool
static bool
tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK)
{
List *i;