fix: for the function is_existing, stop the transaction if not found.

This commit is contained in:
damien DELPY 2024-11-27 10:33:43 +01:00
parent 86c6fedb30
commit 424cce390e
No known key found for this signature in database

View File

@ -10,7 +10,7 @@ CREATE OR REPLACE FUNCTION is_existing_piece(
BEGIN BEGIN
IF NOT EXISTS(SELECT 1 FROM etre WHERE id_piece = toadd_id_piece) THEN 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; RETURN;
END IF; END IF;