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 23:08:09 -0000
***************
*** 28,33 ****
--- 28,34 ----
  #include "utils/syscache.h"
  #include "utils/typcache.h"
  
+ oper_select_hook_type oper_select_hook = NULL;
  
  static Oid	binary_oper_exact(List *opname, Oid arg1, Oid arg2);
  static FuncDetailCode oper_select_candidate(int nargs,
***************
*** 528,534 ****
  				ltypeId = rtypeId;
  			inputOids[0] = ltypeId;
  			inputOids[1] = rtypeId;
! 			fdresult = oper_select_candidate(2, inputOids, clist, &operOid);
  		}
  	}
  
--- 529,544 ----
  				ltypeId = rtypeId;
  			inputOids[0] = ltypeId;
  			inputOids[1] = rtypeId;
! 
! 			/*
! 			 * Allow user defined operator selection, allowing hard-coding
! 			 * cacheing or other mechanisms of operator selection for
! 			 * improved performance in certain circumstances
! 			 */
! 			if (oper_select_hook)
! 				fdresult = (* oper_select_hook) (2, inputOids, clist, &operOid);
! 			else
! 				fdresult = oper_select_candidate(2, inputOids, clist, &operOid);
  		}
  	}
  
Index: src/include/parser/parse_oper.h
===================================================================
RCS file: /home/sriggs/pg/REPOSITORY/pgsql/src/include/parser/parse_oper.h,v
retrieving revision 1.41
diff -c -r1.41 parse_oper.h
*** src/include/parser/parse_oper.h	5 Jan 2007 22:19:57 -0000	1.41
--- src/include/parser/parse_oper.h	26 Nov 2007 23:03:57 -0000
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/htup.h"
  #include "parser/parse_node.h"
+ #include "parser/parse_func.h"
  
  
  typedef HeapTuple Operator;
***************
*** 37,42 ****
--- 38,49 ----
  extern Operator left_oper(ParseState *pstate, List *op, Oid arg,
  		  bool noError, int location);
  
+ typedef FuncDetailCode (*oper_select_hook_type) (int nargs,
+ 					  							  Oid *input_typeids,
+ 					  							  FuncCandidateList candidates,
+ 					  							  Oid *operOid);
+ extern PGDLLIMPORT oper_select_hook_type oper_select_hook;
+ 
  /* Routines to find operators that DO NOT require coercion --- ie, their */
  /* input types are either exactly as given, or binary-compatible */
  extern Operator compatible_oper(ParseState *pstate, List *op,
