diff options
| author | Tom Lane | 2000-02-26 21:11:10 +0000 |
|---|---|---|
| committer | Tom Lane | 2000-02-26 21:11:10 +0000 |
| commit | 79ef3cda9958a70c005428eda1f11845c41cdcee (patch) | |
| tree | a4472bd35b8168fb1ebdc5c52b90151537e4145f /src/include/parser/parse_expr.h | |
| parent | 4450e4a900996dfe4302449f695dd2a51f84968b (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/parse_expr.h')
| -rw-r--r-- | src/include/parser/parse_expr.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/parser/parse_expr.h b/src/include/parser/parse_expr.h index 8d8a3ae28a..3e8291261c 100644 --- a/src/include/parser/parse_expr.h +++ b/src/include/parser/parse_expr.h @@ -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 */ |
