Search Postgresql Archives

Re: check_function_bodies not doing much

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

2018-08-07 21:17 GMT+02:00 Marcelo Lacerda <marceloslacerda@xxxxxxxxx>:
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?

Example:
http://paste.debian.net/1037080/

It is expected behave. PL/pgSQL checks immediately only syntax of embedded SQL. With this design plpgsql functions are not too sensitive on objects' dependency. You can use reference on temporary tables what usually doesn't exists in plpgsql validation time.

For deeper check you can use plpgsql_check https://github.com/okbob/plpgsql_check

It does almost all possible static checks.

Regards

Pavel


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux