From 424cce390e75b13592e01b4b50b9f3bb1d4877a3 Mon Sep 17 00:00:00 2001 From: damien DELPY Date: Wed, 27 Nov 2024 10:33:43 +0100 Subject: [PATCH] fix: for the function is_existing, stop the transaction if not found. --- PostgreSQL/src/update.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PostgreSQL/src/update.sql b/PostgreSQL/src/update.sql index 76d23bc..3f0efbd 100644 --- a/PostgreSQL/src/update.sql +++ b/PostgreSQL/src/update.sql @@ -10,7 +10,7 @@ CREATE OR REPLACE FUNCTION is_existing_piece( BEGIN IF NOT EXISTS(SELECT 1 FROM etre WHERE id_piece = toadd_id_piece) THEN - RAISE NOTICE 'The % piece does not exist.', toadd_id_piece; + RAISE EXCEPTION 'The % piece does not exist.', toadd_id_piece; RETURN; END IF;