OSDN Git Service

Separate parse-analysis for utility commands out of parser/analyze.c
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 23 Jun 2007 22:12:52 +0000 (22:12 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 23 Jun 2007 22:12:52 +0000 (22:12 +0000)
commit46379d6e60f0f95e127a5045ca1fa74dfdc48a85
tree7d6fe8004575203b40a38184c154dc7f34a20345
parentec0bb02db8452d4098023f82b100ba68d8f7dfab
Separate parse-analysis for utility commands out of parser/analyze.c
(which now deals only in optimizable statements), and put that code
into a new file parser/parse_utilcmd.c.  This helps clarify and enforce
the design rule that utility statements shouldn't be processed during
the regular parse analysis phase; all interpretation of their meaning
should happen after they are given to ProcessUtility to execute.
(We need this because we don't retain any locks for a utility statement
that's in a plan cache, nor have any way to detect that it's stale.)

We are also able to simplify the API for parse_analyze() and related
routines, because they will now always return exactly one Query structure.

In passing, fix bug #3403 concerning trying to add a serial column to
an existing temp table (this is largely Heikki's work, but we needed
all that restructuring to make it safe).
23 files changed:
src/backend/commands/indexcmds.c
src/backend/commands/prepare.c
src/backend/commands/schemacmds.c
src/backend/commands/tablecmds.c
src/backend/commands/view.c
src/backend/nodes/makefuncs.c
src/backend/optimizer/util/clauses.c
src/backend/parser/Makefile
src/backend/parser/README
src/backend/parser/analyze.c
src/backend/parser/gram.y
src/backend/parser/parse_clause.c
src/backend/parser/parse_expr.c
src/backend/parser/parse_node.c
src/backend/parser/parse_utilcmd.c [new file with mode: 0644]
src/backend/rewrite/rewriteDefine.c
src/backend/tcop/postgres.c
src/backend/tcop/utility.c
src/include/nodes/makefuncs.h
src/include/nodes/parsenodes.h
src/include/parser/analyze.h
src/include/parser/parse_node.h
src/include/parser/parse_utilcmd.h [new file with mode: 0644]