Обсуждение: pgsql: Transform ALTER TABLE/SET TYPE/USING expr during parse analysis

Поиск
Список
Период
Сортировка

pgsql: Transform ALTER TABLE/SET TYPE/USING expr during parse analysis

От
Alvaro Herrera
Дата:
Transform ALTER TABLE/SET TYPE/USING expr during parse analysis

This lets later stages have access to the transformed expression; in
particular it allows DDL-deparsing code during event triggers to pass
the transformed expression to ruleutils.c, so that the complete command
can be deparsed.

This shuffles the timing of the transform calls a bit: previously,
nothing was transformed during parse analysis, and only the
RELKIND_RELATION case was being handled during execution.  After this
patch, all expressions are transformed during parse analysis (including
those for relkinds other than RELATION), and the error for other
relation kinds is thrown only during execution.  So we do more work than
before to reject some bogus cases.  That seems acceptable.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9550e8348b7965715789089555bb5a3fda8c269c

Modified Files
--------------
src/backend/commands/tablecmds.c   |   35 +++++++------------------------
src/backend/parser/parse_utilcmd.c |   40 +++++++++++++++++++++++++++++++++---
2 files changed, 44 insertions(+), 31 deletions(-)