Skip to content
Snippets Groups Projects
Commit 7fdc3529 authored by Raphael Das Gupta's avatar Raphael Das Gupta
Browse files

Don't abort containt tests when ON_ERROR_STOP is enabled

parent f5ea1cc6
Branches
Tags
No related merge requests found
......@@ -86,7 +86,8 @@ ROLLBACK;
-- Constraints Tests
-- do not alter contents of the database persistently
BEGIN;
DO
$$BEGIN
ALTER TABLE Angestellter
ADD CONSTRAINT check_Salaer
......@@ -96,10 +97,14 @@ UPDATE angestellter SET salaer=30000 where persnr = 1100;
select * from angestellter WHERE persnr = 1100;
-- forget all changes made since BEGIN
ROLLBACK;
EXCEPTION
WHEN integrity_constraint_violation THEN
RAISE NOTICE 'The constraint worked and made the UPDATE fail with message: %', SQLERRM;
END;$$;
-- do not alter contents of the database persistently
BEGIN;
DO
$$BEGIN
ALTER TABLE ProjektZuteilung
ADD CONSTRAINT check_Zeitanteil
......@@ -109,4 +114,7 @@ UPDATE ProjektZuteilung SET Zeitanteil=99 where persnr = 1100;
select * from ProjektZuteilung WHERE persnr = 1100;
-- forget all changes made since BEGIN
ROLLBACK;
EXCEPTION
WHEN integrity_constraint_violation THEN
RAISE NOTICE 'The constraint worked and made the UPDATE fail with message: %', SQLERRM;
END;$$;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment