The syntax SELECT FOR UPDATEtells PG that you are about to update these records and block them from being accessed simultaneously. However, you still need to issue an appropriate call UPDATEto modify certain entries that you have blocked.
In this case, just use the same WHEREsentence in UPDATE, for example:
UPDATE video SET schedulingflag = true
WHERE schedulingflag IS FALSE AND errorflag IS FALSE;
source
share