diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-02-21 18:47:12 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-02-21 18:47:12 +0000 |
commit | 393f313227fba2b7905cfbd69b3e4c18d762bf4f (patch) | |
tree | 0eab81bd6705a19b625880d9b5cefb1d50c78d78 /src/backend/parser/parse_expr.c | |
parent | ee97d103ccf68ae45343caea4188ca3dd5ce7365 (diff) | |
download | postgresql-393f313227fba2b7905cfbd69b3e4c18d762bf4f.tar.gz postgresql-393f313227fba2b7905cfbd69b3e4c18d762bf4f.zip |
Change parse-time representation of float literals (which include oversize
integers) to be strings instead of 'double'. We convert from string form
to internal representation only after type resolution has determined the
correct type for the constant. This eliminates loss-of-precision worries
and gets rid of the change in behavior seen at 17 digits with the
previous kluge.
Diffstat (limited to 'src/backend/parser/parse_expr.c')
-rw-r--r-- | src/backend/parser/parse_expr.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 3fd3370672f..2efdd136005 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.69 2000/02/20 21:32:10 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.70 2000/02/21 18:47:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -726,23 +726,19 @@ parser_typecast_constant(Value *expr, TypeName *typename) switch (nodeTag(expr)) { - case T_String: - const_string = DatumGetPointer(expr->val.str); - break; case T_Integer: string_palloced = true; const_string = int4out(expr->val.ival); break; case T_Float: - string_palloced = true; - const_string = float8out(&expr->val.dval); + case T_String: + const_string = expr->val.str; break; case T_Null: isNull = true; break; default: - elog(ERROR, - "Cannot cast this expression to type '%s'", + elog(ERROR, "Cannot cast this expression to type '%s'", typename->name); } |