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