diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 6c3d89a14f6b1f19176864af4a0ea18eebd9f4bd..4db57a704a46a4737f951e5d8543fcc21676472c 100644
*** a/src/backend/parser/analyze.c
--- b/src/backend/parser/analyze.c
*************** transformInsertStmt(ParseState *pstate, 
*** 652,657 ****
--- 652,658 ----
  		 * to ensure that the values would be available while evaluating the
  		 * VALUES RTE.	This is a shame.  FIXME
  		 */
+ #if 0
  		if (list_length(pstate->p_rtable) != 1 &&
  			contain_vars_of_level((Node *) exprsLists, 0))
  			ereport(ERROR,
*************** transformInsertStmt(ParseState *pstate, 
*** 660,665 ****
--- 661,667 ----
  					 errhint("Use SELECT ... UNION ALL ... instead."),
  					 parser_errposition(pstate,
  							  locate_var_of_level((Node *) exprsLists, 0))));
+ #endif
  
  		/*
  		 * Generate the VALUES RTE
*************** transformInsertStmt(ParseState *pstate, 
*** 672,677 ****
--- 674,683 ----
  		Assert(rte == rt_fetch(rtr->rtindex, pstate->p_rtable));
  		pstate->p_joinlist = lappend(pstate->p_joinlist, rtr);
  
+ 		if (list_length(pstate->p_rtable) != 1 &&
+ 			contain_vars_of_level((Node *) exprsLists, 0))
+ 			rte->lateral = true;
+ 
  		/*
  		 * Generate list of Vars referencing the RTE
  		 */
*************** transformValuesClause(ParseState *pstate
*** 1222,1233 ****
--- 1228,1242 ----
  	 */
  	if (list_length(pstate->p_rtable) != 1 &&
  		contain_vars_of_level((Node *) exprsLists, 0))
+ 		rte->lateral = true;
+ #if 0
  		ereport(ERROR,
  				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
  				 errmsg("VALUES must not contain OLD or NEW references"),
  				 errhint("Use SELECT ... UNION ALL ... instead."),
  				 parser_errposition(pstate,
  							  locate_var_of_level((Node *) exprsLists, 0))));
+ #endif
  
  	qry->rtable = pstate->p_rtable;
  	qry->jointree = makeFromExpr(pstate->p_joinlist, NULL);
