X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 33D819DC99A for ; Tue, 17 Jan 2006 13:56:54 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 15383-07 for ; Tue, 17 Jan 2006 13:56:53 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 544BD9DC983 for ; Tue, 17 Jan 2006 13:56:51 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id k0HHugHW017260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 Jan 2006 10:56:45 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id k0HHugN0011448; Tue, 17 Jan 2006 10:56:42 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id k0HHugSf011447; Tue, 17 Jan 2006 10:56:42 -0700 (MST) (envelope-from mfuhr) Date: Tue, 17 Jan 2006 10:56:42 -0700 From: Michael Fuhr To: Michael Glaesemann Cc: "Christian Paul B. Cosinas" , pgsql-sql@postgresql.org Subject: Re: Characters that needs escape characters when inserting to database Message-ID: <20060117175642.GA11363@winnie.fuhr.org> References: <00fc01c61bb4$5ae92590$1e21100a@ghwk02002147> <963723D6-0891-4EF0-8324-0D4E5FCF69AA@myrealbox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <963723D6-0891-4EF0-8324-0D4E5FCF69AA@myrealbox.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.099 required=5 tests=[AWL=0.099] X-Spam-Score: 0.099 X-Spam-Level: X-Archive-Number: 200601/106 X-Sequence-Number: 23895 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