On Tue, Aug 7, 2018 at 12:31 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Marcelo Lacerda <marceloslace...@gmail.com> writes: > > I was trying to get postgres to warn me that I'm referencing a table that > > it doesn't exists inside a function so I was told on the IRC to check the > > setting "check_function_bodies", however when I use it in a plpgsql > > function it doesn't actually check if the tables in the body exist. Is > this > > the correct behavior? > > Yes. It's supposed to be a syntax check, not a check that the function > would work when executed. (Depending on the particular PL you're using, > which you didn't mention, it might be a pretty weak syntax check too.) > The quoted text includes "however when I use it in a plpgsql function" so we're good there. Might be worth updating the docs for the GUC (or a note in the languages themselves) to mention what the check covers for each of them. At least distinguishing between syntax and semantics for each. David J.