has_type_privilege_name(PG_FUNCTION_ARGS)
{
	text	   *typename = PG_GETARG_TEXT_P(0);
	text	   *priv_type_text = PG_GETARG_TEXT_P(1);
	Oid			roleid;
	Oid			typeoid;
	AclMode		mode;
	AclResult	aclresult;

	roleid = GetUserId();
	typeoid = convert_type_name(typename);
	mode = convert_type_priv_string(priv_type_text);

	aclresult = pg_type_aclcheck(typeoid, roleid, mode);

	PG_RETURN_BOOL(aclresult == ACLCHECK_OK);
}
has_type_privilege_name(PG_FUNCTION_ARGS)
{
	text	   *typename = PG_GETARG_TEXT_P(0);
	text	   *priv_type_text = PG_GETARG_TEXT_P(1);
	Oid			roleid;
	Oid			typeoid;
	AclMode		mode;
	AclResult	aclresult;

	roleid = GetUserId();
	typeoid = convert_type_name(typename);
	mode = convert_type_priv_string(priv_type_text);

	aclresult = pg_type_aclcheck(typeoid, roleid, mode);

	PG_RETURN_BOOL(aclresult == ACLCHECK_OK);
}