I think you want just LOCK TABLE tab IN SHARE ROW EXCLUSIVE MODEor LOCK TABLE tab IN EXCLUSIVE MODE. The latter would lock outSELECT FOR UPDATE, the former wouldn't.
regards, tom lane