6
6
*
7
7
*
8
8
* IDENTIFICATION
9
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.21 1997/08/19 21:32:12 momjian Exp $
9
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.22 1997/08/22 00:02:05 momjian Exp $
10
10
*
11
11
*-------------------------------------------------------------------------
12
12
*/
@@ -373,6 +373,7 @@ equivalentOpersAfterPromotion(CandidateList candidates)
373
373
case FLOAT4OID :
374
374
case INT4OID :
375
375
case INT2OID :
376
+ case CASHOID :
376
377
c -> args [0 ] = FLOAT8OID ;
377
378
break ;
378
379
default :
@@ -383,6 +384,7 @@ equivalentOpersAfterPromotion(CandidateList candidates)
383
384
case FLOAT4OID :
384
385
case INT4OID :
385
386
case INT2OID :
387
+ case CASHOID :
386
388
c -> args [1 ] = FLOAT8OID ;
387
389
break ;
388
390
default :
@@ -570,6 +572,7 @@ unary_oper_get_candidates(char *op,
570
572
opKey [1 ].sk_argument = CharGetDatum (rightleft );
571
573
572
574
/* currently, only "unknown" can be coerced */
575
+ /* but we should allow types that are internally the same to be "coerced" */
573
576
if (typeId != UNKNOWNOID ) {
574
577
return 0 ;
575
578
}
@@ -956,7 +959,14 @@ can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids)
956
959
*/
957
960
for (i = 0 ; i < nargs ; i ++ ) {
958
961
if (input_typeids [i ] != func_typeids [i ]) {
959
- if (input_typeids [i ] != UNKNOWNOID || func_typeids [i ] == 0 )
962
+ if ((input_typeids [i ] == BPCHAROID && func_typeids [i ] == TEXTOID ) ||
963
+ (input_typeids [i ] == BPCHAROID && func_typeids [i ] == VARCHAROID ) ||
964
+ (input_typeids [i ] == VARCHAROID && func_typeids [i ] == TEXTOID ) ||
965
+ (input_typeids [i ] == VARCHAROID && func_typeids [i ] == BPCHAROID ) ||
966
+ (input_typeids [i ] == CASHOID && func_typeids [i ] == INT4OID ) ||
967
+ (input_typeids [i ] == INT4OID && func_typeids [i ] == CASHOID ))
968
+ ; /* these are OK */
969
+ else if (input_typeids [i ] != UNKNOWNOID || func_typeids [i ] == 0 )
960
970
return false;
961
971
962
972
tp = get_id_type (input_typeids [i ]);
0 commit comments