Hi, i'm wondering if there is a way to prepare and execute a plan in a plpgsql function. The prepare seems to work as expected but obviously the execute plan_name(...) statement is interpreted as the plpgsql execute keyword and says me that the plan_name function don't exists is there a way to use prepared queries in plpgsql? if not what is the best way to pass a parameter directly to a query? (im using postGIS and it would be nice if I could use another way that unparsing and parsing a geometry parameter in an execute dynamic query) thank you and have all a nice day!
Jocelyn Turcotte <turcotte.j@gmail.com> writes:
> i'm wondering if there is a way to prepare and execute a plan in a
> plpgsql function.
You do not need that because plpgsql automatically caches plans for
SQL statements appearing in a plpgsql function.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера