Project

General

Profile

« Previous | Next » 

Revision 13493

bugfix: schemas/util.sql: try_cast(), is_castable(): also need to handle syntax_error_or_access_rule_violation, which is thrown by ::regclass

View differences:

trunk/schemas/util.sql
2026 2026
	IF value IS NULL THEN RETURN NULL; END IF; -- pass NULL through
2027 2027
	RETURN true;
2028 2028
EXCEPTION
2029
WHEN data_exception THEN RETURN false;
2029
WHEN   data_exception
2030
	OR syntax_error_or_access_rule_violation -- eg. ::regclass
2031
	THEN
2032
	RETURN false;
2030 2033
END;
2031 2034
$$;
2032 2035

  
......
4093 4096
	return type happen at the end of the function, outside any block.) */
4094 4097
	RETURN util.cast(value, ret_type_null);
4095 4098
EXCEPTION
4096
WHEN data_exception THEN
4099
WHEN   data_exception
4100
	OR syntax_error_or_access_rule_violation -- eg. ::regclass
4101
	THEN
4097 4102
	PERFORM util.raise('WARNING', SQLERRM);
4098 4103
	RETURN NULL;
4099 4104
END;

Also available in: Unified diff