diff -c -r src.orig/backend/parser/parse_oper.c src/backend/parser/parse_oper.c
*** src.orig/backend/parser/parse_oper.c	2011-06-02 13:18:19.000000000 +0400
--- src/backend/parser/parse_oper.c	2011-06-02 14:03:55.000000000 +0400
***************
*** 246,251 ****
--- 246,293 ----
  			hashable = false;
  		}
  	}
+ 	else if (lt_opr == RECORD_LT_OP ||
+ 				eq_opr == RECORD_EQ_OP ||
+ 				gt_opr == RECORD_GT_OP)
+ 	{
+ 		/*
+ 		 * Do similar check for row type. Corresponding operators 
+ 		 * should exist for all subtypes of row type.
+ 		 */
+ 		TupleDesc	tupdesc;
+ 		int 		i;
+ 		Oid 		subLtOpr,
+ 					subEqOpr,
+ 					subGtOpr;
+ 		bool 		subIsHashable;
+ 
+ 		tupdesc = lookup_rowtype_tupdesc(argtype, -1);
+ 
+ 		for(i=0; i<tupdesc->natts; i++)
+ 		{
+ 			if (tupdesc->attrs[i]->attisdropped)
+ 				continue;
+ 
+ 				get_sort_group_operators(tupdesc->attrs[i]->atttypid,
+ 						 					false, false, false,
+ 						 					&subLtOpr, &subEqOpr, &subGtOpr,
+ 											&subIsHashable);
+ 
+ 				if (!OidIsValid(subLtOpr))
+ 					lt_opr = InvalidOid; 
+ 				if (!OidIsValid(subEqOpr))
+ 					eq_opr = InvalidOid; 
+ 				if (!OidIsValid(subGtOpr))
+ 					gt_opr = InvalidOid; 
+ 		}
+ 
+ 		ReleaseTupleDesc(tupdesc);
+ 
+ 		/*
+ 		 * there is no hash opclass for row type
+ 		 */
+ 		hashable = false;
+ 	}
  
  	/* Report errors if needed */
  	if ((needLT && !OidIsValid(lt_opr)) ||
diff -c -r src.orig/include/catalog/pg_operator.h src/include/catalog/pg_operator.h
*** src.orig/include/catalog/pg_operator.h	2011-06-02 13:18:19.000000000 +0400
--- src/include/catalog/pg_operator.h	2011-06-02 13:30:27.000000000 +0400
***************
*** 1646,1657 ****
--- 1646,1660 ----
  
  /* generic record comparison operators */
  DATA(insert OID = 2988 (  "="	   PGNSP PGUID b t f 2249 2249 16 2988 2989 record_eq eqsel eqjoinsel ));
+ #define RECORD_EQ_OP 2988
  DESCR("equal");
  DATA(insert OID = 2989 (  "<>"	   PGNSP PGUID b f f 2249 2249 16 2989 2988 record_ne neqsel neqjoinsel ));
  DESCR("not equal");
  DATA(insert OID = 2990 (  "<"	   PGNSP PGUID b f f 2249 2249 16 2991 2993 record_lt scalarltsel scalarltjoinsel ));
+ #define RECORD_LT_OP 2990
  DESCR("less than");
  DATA(insert OID = 2991 (  ">"	   PGNSP PGUID b f f 2249 2249 16 2990 2992 record_gt scalargtsel scalargtjoinsel ));
+ #define RECORD_GT_OP 2991
  DESCR("greater than");
  DATA(insert OID = 2992 (  "<="	   PGNSP PGUID b f f 2249 2249 16 2993 2991 record_le scalarltsel scalarltjoinsel ));
  DESCR("less than or equal");
