From: Michael Fuhr <mike@fuhr.org>
To: Michael Glaesemann <grzm@myrealbox.com>
Cc: Christian Paul B. Cosinas <cpc@cybees.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Characters that needs escape characters when inserting to database
Date: Tue, 17 Jan 2006 10:56:42 -0700
Message-ID: <20060117175642.GA11363@winnie.fuhr.org> (raw)
In-Reply-To: <963723D6-0891-4EF0-8324-0D4E5FCF69AA@myrealbox.com>
References: <00fc01c61bb4$5ae92590$1e21100a@ghwk02002147>
<963723D6-0891-4EF0-8324-0D4E5FCF69AA@myrealbox.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mike@fuhr.org, grzm@myrealbox.com, cpc@cybees.com
Subject: Re: Characters that needs escape characters when inserting to database
In-Reply-To: <20060117175642.GA11363@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox