pgsql: Fix up ruleutils.c for CTE features.

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Fix up ruleutils.c for CTE features.
Дата
Msg-id 20081006202938.B45197545A4@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Fix up ruleutils.c for CTE features.  The main problem was that
get_name_for_var_field didn't have enough context to interpret a reference to
a CTE query's output.  Fixing this requires separate hacks for the regular
deparse case (pg_get_ruledef) and for the EXPLAIN case, since the available
context information is quite different.  It's pretty nearly parallel to the
existing code for SUBQUERY RTEs, though.  Also, add code to make sure we
qualify a relation name that matches a CTE name; else the CTE will mistakenly
capture the reference when reloading the rule.

In passing, fix a pre-existing problem with get_name_for_var_field not working
on variables in targetlists of SubqueryScan plan nodes.  Although latent all
along, this wasn't a problem until we made EXPLAIN VERBOSE try to print
targetlists.  To do this, refactor the deparse_context_for_plan API so that
the special case for SubqueryScan is all on ruleutils.c's side.

Modified Files:
--------------
    pgsql/src/backend/commands:
        explain.c (r1.179 -> r1.180)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/explain.c?r1=1.179&r2=1.180)
    pgsql/src/backend/utils/adt:
        ruleutils.c (r1.286 -> r1.287)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/ruleutils.c?r1=1.286&r2=1.287)
    pgsql/src/include/utils:
        builtins.h (r1.322 -> r1.323)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/builtins.h?r1=1.322&r2=1.323)

В списке pgsql-committers по дате отправления:

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: When expanding a whole-row Var into a RowExpr during
Следующее
От: hinoue@pgfoundry.org (User Hinoue)
Дата:
Сообщение: psqlodbc - psqlodbc: Remove some compiler warnings thanks to Zoltan