Re: [DOCS] Further Clarification request

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [DOCS] Further Clarification request
Дата
Msg-id CAKFQuwYS8k+qvsPXBWc-2yp08QkHtm_pD_bD5eKuSGZWJA4ebw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [DOCS] Further Clarification request  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-docs
On Wed, Aug 9, 2017 at 4:03 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wed, Aug 9, 2017 at 3:21 PM, Jym Morton <jym@outlook.com> wrote:

When I write software, and use a database I don’t need to escape literals if I have a Prepared Statement.  This is a major reason some of us use Prepared Statements.   So, when I looked at this page, I was unclear about was whether it or not I had to do it. 


(​pseudo-code)​
PREPARE 'SELECT $1';
EXECTUE ('; TRUNCATE pg_catalog');


​To be clear - you only need to escape the single quote once - to write the original literal.

EXECUTE ('bob''s niece')​ -- bob's niece, with no risk of SQL injection

David J.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [DOCS] Further Clarification request
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [DOCS] Syntax for changing owner on sequence is not correct