fix: for the function is_existing, stop the transaction if not found.
This commit is contained in:
parent
86c6fedb30
commit
424cce390e
@ -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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user