diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index 72e80f2..0d21cc0 100644
*** a/contrib/dblink/dblink.c
--- b/contrib/dblink/dblink.c
*************** dblink_record_internal(FunctionCallInfo 
*** 920,926 ****
  		/*
  		 * check result and tuple descriptor have the same number of columns
  		 */
! 		if (PQnfields(res) != tupdesc->natts)
  			ereport(ERROR,
  					(errcode(ERRCODE_DATATYPE_MISMATCH),
  					 errmsg("remote query result rowtype does not match "
--- 920,926 ----
  		/*
  		 * check result and tuple descriptor have the same number of columns
  		 */
! 		if (!is_sql_cmd && PQnfields(res) != tupdesc->natts)
  			ereport(ERROR,
  					(errcode(ERRCODE_DATATYPE_MISMATCH),
  					 errmsg("remote query result rowtype does not match "
