*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.34 1997/08/19 21:32:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.35 1997/08/22 00:02:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
} else
if (attrtype != type_id) {
if ((attrtype == INT2OID) && (type_id == INT4OID))
- lfirst(expr) = lispInteger (INT2OID);
+ lfirst(expr) = lispInteger (INT2OID); do CASHOID too
else if ((attrtype == FLOAT4OID) && (type_id == FLOAT8OID))
lfirst(expr) = lispInteger (FLOAT4OID);
else
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.21 1997/08/19 21:32:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.22 1997/08/22 00:02:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
case FLOAT4OID:
case INT4OID:
case INT2OID:
+ case CASHOID:
c->args[0] = FLOAT8OID;
break;
default:
case FLOAT4OID:
case INT4OID:
case INT2OID:
+ case CASHOID:
c->args[1] = FLOAT8OID;
break;
default:
opKey[1].sk_argument = CharGetDatum(rightleft);
/* currently, only "unknown" can be coerced */
+ /* but we should allow types that are internally the same to be "coerced" */
if (typeId != UNKNOWNOID) {
return 0;
}
*/
for (i=0; i<nargs; i++) {
if (input_typeids[i] != func_typeids[i]) {
- if (input_typeids[i] != UNKNOWNOID || func_typeids[i] == 0)
+ if ((input_typeids[i] == BPCHAROID && func_typeids[i] == TEXTOID) ||
+ (input_typeids[i] == BPCHAROID && func_typeids[i] == VARCHAROID) ||
+ (input_typeids[i] == VARCHAROID && func_typeids[i] == TEXTOID) ||
+ (input_typeids[i] == VARCHAROID && func_typeids[i] == BPCHAROID) ||
+ (input_typeids[i] == CASHOID && func_typeids[i] == INT4OID) ||
+ (input_typeids[i] == INT4OID && func_typeids[i] == CASHOID))
+ ; /* these are OK */
+ else if (input_typeids[i] != UNKNOWNOID || func_typeids[i] == 0)
return false;
tp = get_id_type(input_typeids[i]);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.17 1997/08/19 21:32:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.18 1997/08/22 00:02:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
(t) == INT4OID || \
(t) == OIDOID || \
(t) == FLOAT4OID || \
- (t) == FLOAT8OID)
+ (t) == FLOAT8OID || \
+ (t) == CASHOID)
/* binary operator */
ltypeId = (ltree==NULL) ? UNKNOWNOID : exprType(ltree);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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);
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 );
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_type.h,v 1.14 1997/08/21 01:37:55 vadim Exp $
+ * $Id: pg_type.h,v 1.15 1997/08/22 00:02:19 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
DATA(insert OID = 718 ( circle PGUID 24 47 f b t \054 0 0 circle_in circle_out circle_in circle_out d _null_ ));
DATA(insert OID = 719 ( _circle PGUID -1 -1 f b t \054 0 718 array_in array_out array_in array_out d _null_ ));
DATA(insert OID = 790 ( money PGUID 4 24 f b t \054 0 0 cash_in cash_out cash_in cash_out i _null_ ));
+#define CASHOID 790
DATA(insert OID = 791 ( _money PGUID -1 -1 f b t \054 0 790 array_in array_out array_in array_out i _null_ ));
/* OIDS 800 - 899 */