From 3dd23aadf0746ba53ffe3ca76863a0ffbbeb0c68 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 22 Aug 1997 00:02:19 +0000 Subject: Allow functions and operators on internally-identical types to succeed. --- src/backend/parser/parser.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/backend/parser/parser.c') diff --git a/src/backend/parser/parser.c b/src/backend/parser/parser.c index 14f110767f3..44e8ef91006 100644 --- a/src/backend/parser/parser.c +++ b/src/backend/parser/parser.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.20 1997/08/03 02:28:10 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.21 1997/08/22 00:02:08 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -238,6 +238,13 @@ parser_typecast(Value *expr, TypeName *typename, int typlen) string_palloced = true; sprintf(const_string,"%f", ((Const)lnext(expr))->constvalue); break; + + case CASHOID: /* money */ + const_string = (char *) palloc(256); + string_palloced = true; + sprintf(const_string,"%ld", + (int) ((Const*)expr)->constvalue); + break; case TEXTOID: /* text */ const_string = DatumGetPointer(((Const)lnext(expr))->constvalue); @@ -350,6 +357,12 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen) sprintf(const_string,"%f", *floatVal); break; } + case CASHOID: /* money */ + const_string = (char *) palloc(256); + string_palloced = true; + sprintf(const_string,"%ld", + (long) ((Const*)expr)->constvalue); + break; case TEXTOID: /* text */ const_string = DatumGetPointer(((Const*)expr)->constvalue ); -- cgit v1.2.3