| От | Tom Lane |
|---|---|
| Тема | Re: Dynamic Query |
| Дата | |
| Msg-id | 13151.1255992938@sss.pgh.pa.us обсуждение |
| Ответ на | Dynamic Query (Andrew Hall <andrewah@hotmail.com>) |
| Список | pgsql-sql |
Andrew Hall <andrewah@hotmail.com> writes:
> Is there a recommended way to translate this function into plpgSQL which would protect me from SQL Injection (most
importantfor me) and use bind variables (of secondary importance?
See quote_literal() and/or quote_nullable(). On the whole though I
think you'd be best off not using a dynamically-constructed query at
all --- given the desired %'s in the LIKE pattern, there is not going
to be any benefit at all from using an unparameterized query. Just
write it out without all the string-construction.
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера