Hello,
PG: 9.4
CentOS 6
I am writing functions to lock results.
Let's take an example:
CREATE OR REPLACE FUNCTION usp_locking_my_result($1 VARCHAR(50), $2 VARCHAR(50))
RETURNS TEXT AS $$
SELECT value
FROM my_table
WHERE field1 = $1 AND field2 = $2 FOR UPDATE;
$$ LANGUAGE SQL;
What happens if one of those arguments are empty and database finds results? ( I think they will locked )
Should I check the inputs and raise an exception if there are empty ?
Thank,
Saïd