Re: Problem with character ' (single quote) in text fields
В списке pgsql-general по дате отправления:
| От | Jordi |
|---|---|
| Тема | Re: Problem with character ' (single quote) in text fields |
| Дата | |
| Msg-id | a2jnho$nu8$1@news.tht.net обсуждение исходный текст |
| Ответ на | Re: Problem with character ' (single quote) in text fields (Martijn van Oosterhout <kleptog@svana.org>) |
| Список | pgsql-general |
> I beleive that the DB interface layers do this for you if you use the > prepare type statements. I really don't know these statements. Where can I find information about them?. By the way, I'm using C with libpq to access Postgresql. > If I really had to do this a lot I would consider > writing my own function like this: > > mydbsprintf( output, "select * from t where firstname = '$' and description = '$';", > "D'Innocenzo", "blah" ); > > Then that function can do the escaping for you. Then you only need one > buffer to store the final query before executing it. Do you mean create my own version of the sprintf function? It seems a good idea to avoid having to work so many auxiliar buffers... I'm going to look at the gcc source code for the sprintf implementation to see if it is not too difficult... Thanks, Jordi
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера