Re: Characters that needs escape characters when inserting to database - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: Characters that needs escape characters when inserting to database
Date
Msg-id 20060117175642.GA11363@winnie.fuhr.org
Whole thread Raw
In response to Re: Characters that needs escape characters when inserting to database  (Michael Glaesemann <grzm@myrealbox.com>)
Responses Re: Characters that needs escape characters when inserting to database  ("Christian Paul B. Cosinas" <cpc@cybees.com>)
List 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 by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Characters that needs escape characters when inserting to database
Next
From: "George Pavlov"
Date:
Subject: non-equi self-join optimization