the thing with statement_timeout is a little bit of an issue. you could do: SET statement_timeout TO ...; SELECT FOR UPDATE ... SET statement_timeout TO default;
Why not extend the "SET" instruction to allow configuration parameters to be set only in the duration of the transaction or the next "n" commands?