I wonder whether this scenario is safe race condition wise.
I mean is there is any risk that 2 or more queries run in the same time will override themself:
UPDATE table_name
SET process_id = 'foobar'
WHERE process_id IS NULL
AND (...);
Desired scenario is that only one transaction can ever make this update.
Do I need to use some explicit locking mechanism here, or postgres does that for me?