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

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Transform ALTER TABLE/SET TYPE/USING expr during parse analysis
Date: 2015-04-03 20:37:30
Message-ID: E1Ye8LK-0004gH-2N@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-04-03 20:49:59 pgsql: Remove unnecessary variables in _hash_splitbucket().
Previous Message Alvaro Herrera 2015-04-03 14:58:29 pgsql: Add log_min_autovacuum_duration per-table option