Renan Alves Fonseca <renanfons...@gmail.com> writes: > There is a Note that says: "The entire body of an SQL function is > parsed before any of it is executed. While an SQL function can contain > commands that alter ..."
Yup. > If I understood well [2], then both notes may be discarded together in > the next version. No, that aspect is not changed in the currently-proposed patch: we still do parse analysis of all the queries at the beginning. I'd like to make it work differently eventually, but with feature freeze so close I do not think that'll happen for v18. Thinking a bit more about that, if the initial parse analysis succeeds then the patched code will in fact re-parse before execution if any DDL changes have occurred. So you get at least some of the desired behavioral change. But the example given in the docs would still fail, so I don't feel a need to change the docs yet. regards, tom lane