Index: src/backend/parser/parse_oper.c
===================================================================
RCS file: /home/sriggs/pg/REPOSITORY/pgsql/src/backend/parser/parse_oper.c,v
retrieving revision 1.98
diff -c -r1.98 parse_oper.c
*** src/backend/parser/parse_oper.c	22 Nov 2007 19:40:25 -0000	1.98
--- src/backend/parser/parse_oper.c	26 Nov 2007 16:28:42 -0000
***************
*** 28,33 ****
--- 28,34 ----
  #include "utils/syscache.h"
  #include "utils/typcache.h"
  
+ static Oid operOidCache = InvalidOid;
  
  static Oid	binary_oper_exact(List *opname, Oid arg1, Oid arg2);
  static FuncDetailCode oper_select_candidate(int nargs,
***************
*** 516,534 ****
  		/* No operators found? Then fail... */
  		if (clist != NULL)
  		{
! 			/*
! 			 * Unspecified type for one of the arguments? then use the other
! 			 * (XXX this is probably dead code?)
! 			 */
! 			Oid			inputOids[2];
  
! 			if (rtypeId == InvalidOid)
! 				rtypeId = ltypeId;
! 			else if (ltypeId == InvalidOid)
! 				ltypeId = rtypeId;
! 			inputOids[0] = ltypeId;
! 			inputOids[1] = rtypeId;
! 			fdresult = oper_select_candidate(2, inputOids, clist, &operOid);
  		}
  	}
  
--- 517,543 ----
  		/* No operators found? Then fail... */
  		if (clist != NULL)
  		{
! 			if (OidIsValid(operOidCache))
! 				operOid = operOidCache;
! 			else
! 			{
! 				/*
! 				 * Unspecified type for one of the arguments? then use the other
! 				 * (XXX this is probably dead code?)
! 				 */
! 				Oid			inputOids[2];
! 
! 				if (rtypeId == InvalidOid)
! 					rtypeId = ltypeId;
! 				else if (ltypeId == InvalidOid)
! 					ltypeId = rtypeId;
! 				inputOids[0] = ltypeId;
! 				inputOids[1] = rtypeId;
! 				fdresult = oper_select_candidate(2, inputOids, clist, &operOid);
  
! 				if (ltypeId == 1043 && rtypeId == 705)
! 					operOidCache = operOid;
! 			}
  		}
  	}
  
