Refactor parse analysis of EXECUTE command

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-11-01T07:07:16Z
Lists: pgsql-hackers
This patch moves the parse analysis component of ExecuteQuery() and
EvaluateParams() into a new transformExecuteStmt() that is called from
transformStmt().  This makes EXECUTE behave more like other utility
commands.

Effects are that error messages can have position information (see 
regression test case), and it allows using external parameters in the 
arguments of the EXECUTE command.

I had previously inquired about this in [0] and some vague concerns were 
raised.  I haven't dug very deep on this, but I figure with an actual 
patch it might be easier to review and figure out if there are any problems.


[0]: 
https://www.postgresql.org/message-id/flat/ed2767e5-c506-048d-8ddf-280ecbc9e1b7%402ndquadrant.com

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Commits

  1. Make better use of ParseState in ProcessUtility

  2. Add error position to an error message

  3. Do parse analysis of an EXPLAIN's contained statement during the normal

  4. First phase of plan-invalidation project: create a plan cache management