Joseph Shraibman <jks@selectacast.net> writes: > Does plpgsql not short circuit its logic?
We make no guarantees about evaluation order. In the particular case at hand, you're losing because plpgsql has to evaluate all the variables that it's going to pass into the SQL engine for that expression. Break it into two statements ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings