pgsql: Make CREATE INDEX run expression preprocessing on a proposed

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Make CREATE INDEX run expression preprocessing on a proposed
Дата
Msg-id 20100527155910.411317541D2@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Make CREATE INDEX run expression preprocessing on a proposed index expression
before it checks whether the expression is immutable.  This covers two cases
that were previously handled poorly:

1. SQL function inlining could reduce the apparent volatility of the
expression, allowing an expression to be accepted where it previously would
not have been.  As an example, polymorphic functions must be marked with the
worst-case volatility they have for any argument type, but for specific
argument types they might not be so volatile, so indexing could be allowed.
(Since the planner will refuse to inline functions in cases where the
apparent volatility of the expression would increase, this won't break
any cases that were accepted before.)

2. A nominally immutable function could have default arguments that are
volatile expressions.  In such a case insertion of the defaults will increase
both the apparent and actual volatility of the expression, so it is
*necessary* to check this before allowing the expression to be indexed.

Back-patch to 8.4, where default arguments were introduced.

Modified Files:
--------------
    pgsql/src/backend/commands:
        indexcmds.c (r1.195 -> r1.196)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/indexcmds.c?r1=1.195&r2=1.196)

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

Предыдущее
От: itagaki@postgresql.org (Takahiro Itagaki)
Дата:
Сообщение: pgsql: Mark PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 with PGDLLEXPORT
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Make CREATE INDEX run expression preprocessing on a proposed