paste #bEC
:
CREATE OR REPLACE FUNCTION public.plpg_rename(i_person_id bigint, i_item_id integer)
RETURNS boolean
LANGUAGE plpgsql
AS $function$
BEGIN
IF usp_delete_inventory_item(i_person_id, i_item_id) IS NOT NULL THEN
UPDATE person SET name = $1 WHERE person_id = $2;
RETURN TRUE;
END IF;
RETURN FALSE;
END;
$function$
;
CREATE OR REPLACE FUNCTION public.plpg_rename (i_person_id bigint, i_item_id integer)
RETURNS boolean
LANGUAGE plpgsql
AS $function$
BEGIN
IF usp_delete_inventory_item (i_person_id, i_item_id) IS NOT NULL THEN
UPDATE
person
SET
name = $1
WHERE
person_id = $2;
RETURN TRUE;
END IF;
RETURN FALSE;
END;
$function$;
-- Formatted by pgFormatter::Beautify