CREATE OR REPLACE FUNCTION tools.assert(TEXT, BOOLEAN, TEXT) RETURNS BOOLEAN AS $$
	my ($name, $condition, $message) = @_;
	die 'Assertion name is NULL' unless ($name ne '');
	$message = 'Assertion message is NULL' unless ($message ne '');
	die "$message (assertion $name)" if (lc($condition) eq 'f');
	return 1;
$$ LANGUAGE plperlu;