1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

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.
This commit is contained in:
Tom Lane
2000-02-21 18:47:12 +00:00
parent ee97d103cc
commit 393f313227
12 changed files with 186 additions and 186 deletions

View File

@ -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);
}