Thread: pgsql: Add notion of a "transform function" that can simplify function

pgsql: Add notion of a "transform function" that can simplify function

From
Robert Haas
Date:
Add notion of a "transform function" that can simplify function calls.

Initially, we use this only to eliminate calls to the varchar()
function in cases where the length is not being reduced and, therefore,
the function call is equivalent to a RelabelType operation.  The most
significant effect of this is that we can avoid a table rewrite when
changing a varchar(X) column to a varchar(Y) column, where Y > X.

Noah Misch, reviewed by me and Alexey Klyukin

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8f9fe6edce358f7904e0db119416b4d1080a83aa

Modified Files
--------------
doc/src/sgml/catalogs.sgml           |    7 +
src/backend/catalog/pg_proc.c        |    1 +
src/backend/commands/tablecmds.c     |    9 +-
src/backend/optimizer/util/clauses.c |   87 +-
src/backend/parser/parse_clause.c    |   22 +
src/backend/utils/adt/varchar.c      |   34 +
src/include/catalog/catversion.h     |    2 +-
src/include/catalog/pg_class.h       |    2 +-
src/include/catalog/pg_proc.h        | 4568 +++++++++++++++++-----------------
src/include/parser/parse_clause.h    |    2 +
src/include/utils/builtins.h         |    1 +
11 files changed, 2428 insertions(+), 2307 deletions(-)