CREATE OR REPLACE FUNCTION try_but_fail() RETURNS void AS $$
DECLARE
	x int4;
BEGIN
	FOR x IN 1 .. 1000 LOOP
		BEGIN
			PERFORM x / 0;
		EXCEPTION
			WHEN division_by_zero THEN NULL;
		END;
	END LOOP;
END $$ LANGUAGE plpgsql;
