OSDN Git Service

Fix exprTypmod to recognize length-coercion function expressions,
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 26 Feb 2000 21:11:10 +0000 (21:11 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 26 Feb 2000 21:11:10 +0000 (21:11 +0000)
commit7173c485c817735012ceacd8662a0c2aa3068396
tree46cf181e4970ba015fb580631f790334b8228775
parentcbf4c9671ed01c769c6d6abb29fe082437373c33
Fix exprTypmod to recognize length-coercion function expressions,
such as bpchar(char_expression, N), and pull out the attrtypmod that
the function is coercing to.  This allows correct deduction of the
column type in examples such as
CREATE VIEW v AS SELECT f1::char(8) FROM tbl;
Formerly we labeled v's column as char-of-unknown-length not char(8).
Also, this change causes the parser not to insert a redundant length
coercion function if the user has explicitly casted an INSERT or UPDATE
expression to the right length.
src/backend/parser/parse_expr.c
src/include/parser/parse_expr.h