Skip site navigation (1) Skip section navigation (2)

pgsql: Make CREATE INDEX run expression preprocessing on a proposed

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make CREATE INDEX run expression preprocessing on a proposed
Date: 2010-05-27 15:59:10
Message-ID: 20100527155910.411317541D2@cvs.postgresql.org (view raw or flat)
Thread:
Lists: 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 by date

Next:From: Tom LaneDate: 2010-05-27 15:59:15
Subject: pgsql: Make CREATE INDEX run expression preprocessing on a proposed
Previous:From: Takahiro ItagakiDate: 2010-05-27 07:59:49
Subject: pgsql: Mark PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 with PGDLLEXPORT

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group