Unix Technical Forum

pgsql: Keep the planner from failing on "WHERE false AND something IN

This is a discussion on pgsql: Keep the planner from failing on "WHERE false AND something IN within the pgsql Committers forums, part of the PostgreSQL category; --> Log Message: ----------- Keep the planner from failing on "WHERE false AND something IN (SELECT ...)". eval_const_expressions simplifies this ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Committers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 01:49 AM
Tom Lane
 
Posts: n/a
Default pgsql: Keep the planner from failing on "WHERE false AND something IN

Log Message:
-----------
Keep the planner from failing on "WHERE false AND something IN (SELECT ...)".
eval_const_expressions simplifies this to just "WHERE false", but we have
already done pull_up_IN_clauses so the IN join will be done, or at least
planned, anyway. The trouble case comes when the sub-SELECT is itself a join
and we decide to implement the IN by unique-ifying the sub-SELECT outputs:
with no remaining reference to the output Vars in WHERE, we won't have
propagated the Vars up to the upper join point, leading to "variable not found
in subplan target lists" error. Fix by adding an extra scan of in_info_list
and forcing all Vars mentioned therein to be propagated up to the IN join
point. Per bug report from Miroslav Sulc.

Tags:
----
REL7_4_STABLE

Modified Files:
--------------
pgsql/src/backend/optimizer/plan:
initsplan.c (r1.91.2.3 -> r1.91.2.4)
(http://developer.postgresql.org/cvsw....3&r2=1.91.2.4)
planmain.c (r1.78.4.1 -> r1.78.4.2)
(http://developer.postgresql.org/cvsw....1&r2=1.78.4.2)
pgsql/src/include/optimizer:
planmain.h (r1.75.4.1 -> r1.75.4.2)
(http://developer.postgresql.org/cvsw....1&r2=1.75.4.2)

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:00 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com