Re: Characters that needs escape characters when inserting to database

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Characters that needs escape characters when inserting to database
Дата
Msg-id 20060117175642.GA11363@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Characters that needs escape characters when inserting to database  (Michael Glaesemann <grzm@myrealbox.com>)
Ответы Re: Characters that needs escape characters when inserting to database  ("Christian Paul B. Cosinas" <cpc@cybees.com>)
Список pgsql-sql
On Tue, Jan 17, 2006 at 04:20:23PM +0900, Michael Glaesemann wrote:
> On Jan 18, 2006, at 7:21 , Christian Paul B. Cosinas wrote:
> >Can anyone give me a list of characters that needs to be preceded  
> >by an escape character before inserting to database.
> 
> Take a look at this documentation on string constants. It should  
> answer the questions you have.
> http://www.postgresql.org/docs/current/interactive/sql-syntax.html#SQL-SYNTAX-STRINGS

Out of curiosity, why are you asking?  Unless you're implementing
some low-level interface to the database you shouldn't need to worry
about escaping strings; just use your API's quote/escape (or whatever)
function or its placeholder mechanism (if it has one).  If you're
using an interface that doesn't have any of these capabilities, what
is it?  Some people might want to avoid it ;-)

-- 
Michael Fuhr


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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Characters that needs escape characters when inserting to database
Следующее
От: "George Pavlov"
Дата:
Сообщение: non-equi self-join optimization