Re: check_function_bodies not doing much

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: check_function_bodies not doing much
Дата
Msg-id CAFj8pRAuO_dVj57PuwBJ5oFkD7AnwTM=Fg_siobSXMjnBzLmPw@mail.gmail.com
обсуждение исходный текст
Ответ на check_function_bodies not doing much  (Marcelo Lacerda <marceloslacerda@gmail.com>)
Список pgsql-general
Hi

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

В списке pgsql-general по дате отправления:

Предыдущее
От: Marcelo Lacerda
Дата:
Сообщение: check_function_bodies not doing much
Следующее
От: Tom Lane
Дата:
Сообщение: Re: check_function_bodies not doing much