summaryrefslogtreecommitdiff
path: root/src/include/parser
diff options
context:
space:
mode:
authorTom Lane2000-02-26 21:11:10 +0000
committerTom Lane2000-02-26 21:11:10 +0000
commit7173c485c817735012ceacd8662a0c2aa3068396 (patch)
tree46cf181e4970ba015fb580631f790334b8228775 /src/include/parser
parentcbf4c9671ed01c769c6d6abb29fe082437373c33 (diff)
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.
Diffstat (limited to 'src/include/parser')
-rw-r--r--src/include/parser/parse_expr.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/parser/parse_expr.h b/src/include/parser/parse_expr.h
index 5d20173745c..50d7b284bb5 100644
--- a/src/include/parser/parse_expr.h
+++ b/src/include/parser/parse_expr.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: parse_expr.h,v 1.16 2000/01/26 05:58:27 momjian Exp $
+ * $Id: parse_expr.h,v 1.17 2000/02/26 21:11:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -23,5 +23,6 @@
extern Node *transformExpr(ParseState *pstate, Node *expr, int precedence);
extern Oid exprType(Node *expr);
extern int32 exprTypmod(Node *expr);
+extern bool exprIsLengthCoercion(Node *expr, int32 *coercedTypmod);
#endif /* PARSE_EXPR_H */