]> granicus.if.org Git - postgresql/commit
Prevent invoking I/O conversion casts via functional/attribute notation.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 Nov 2010 18:03:19 +0000 (13:03 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 Nov 2010 18:03:19 +0000 (13:03 -0500)
commit543d22fc7423747afd59fe7214f2ddf6259efc62
treeb7c5be5456509ed805cae6ad5488f74530651bb9
parente43fb604d6db229d70d3101aa53348cc16a5473a
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.
doc/src/sgml/ref/create_cast.sgml
doc/src/sgml/syntax.sgml
doc/src/sgml/xfunc.sgml
src/backend/parser/parse_func.c
src/test/regress/expected/rowtypes.out
src/test/regress/sql/rowtypes.sql