pgsql: Prevent invoking I/O conversion casts via functional/attribute n - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Prevent invoking I/O conversion casts via functional/attribute n
Date
Msg-id E1PF9ac-0006YC-Pr@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Prevent invoking I/O conversion casts via functional/attribute notation.

PG 8.4 added a built-in feature for casting pretty much any data type to
string types (text, varchar, etc).  We allowed this to work in any of the
historically-allowed syntaxes: CAST(x AS text), x::text, text(x), or
x.text.  However, multiple complaints have shown that it's too easy to
invoke such casts unintentionally in the latter two styles, particularly
field selection.  To cure the problem with the narrowest possible change
of behavior, disallow use of I/O conversion casts from composite types to
string types via functional/attribute syntax.  The new functionality is
still available via cast syntax.

In passing, document the equivalence of functional and attribute syntax
in a more visible place.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=543d22fc7423747afd59fe7214f2ddf6259efc62

Modified Files
--------------
doc/src/sgml/ref/create_cast.sgml      |   27 ++++++++++++++----
doc/src/sgml/syntax.sgml               |   13 +++++++++
doc/src/sgml/xfunc.sgml                |    8 +++++-
src/backend/parser/parse_func.c        |   28 ++++++++++++++++---
src/test/regress/expected/rowtypes.out |   46 ++++++++++++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql      |   15 ++++++++++
6 files changed, 126 insertions(+), 11 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Add support for detecting register-stack overrun on IA64.
Next
From: andrewd@pgfoundry.org (User Andrewd)
Date:
Subject: pgbuildfarm - client-code: Support buildfarm client maintained git