12) I find it rather suspicious that we make decisions in utility.c solely based on commandType (whether it's CMD_UTILITY or not). IMO it's pretty strange/ugly that T_LetStmt can be both CMD_UTILITY and CMD_PLAN_UTILITY:
case T_LetStmt: { if (pstmt->commandType == CMD_UTILITY) doLetStmtReset(pstmt); else { Assert(pstmt->commandType == CMD_PLAN_UTILITY); doLetStmtEval(pstmt, params, queryEnv, queryString); }
if (completionTag) strcpy(completionTag, "LET"); } break;
It looks strange, but it has sense, because the LET stmt supports reset to default value.
I can write
1. LET var = DEFAULT;
2. LET var = (query);
In first case I have not any query, that I can assign, and in this case the LET statement is really only UTILITY.
I did comment there
Regards
Pavel
regards
-- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services