Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 6ACDF9FBB7F; Mon, 4 Jun 2007 18:15:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 37733-08; Mon, 4 Jun 2007 18:15:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mtao04.charter.net (mtao04.charter.net [209.225.8.178]) by postgresql.org (Postfix) with ESMTP id 9C4BD9FB944; Mon, 4 Jun 2007 18:15:33 -0300 (ADT) Received: from aa02.charter.net ([10.20.200.154]) by mtao04.charter.net (InterMail vM.7.08.02.00 201-2186-121-20061213) with ESMTP id <20070604211527.YIRV1527.mtao04.charter.net@aa02.charter.net>; Mon, 4 Jun 2007 17:15:27 -0400 Received: from [10.0.1.3] (really [66.188.164.45]) by aa02.charter.net with ESMTP id <20070604211527.HJVG22936.aa02.charter.net@[10.0.1.3]>; Mon, 4 Jun 2007 17:15:27 -0400 In-Reply-To: <466471C8.40506@terra.com.br> References: <466471C8.40506@terra.com.br> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <404C8822-2316-42F2-96D0-B89EFDC5F0F7@seespotcode.net> Cc: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: Michael Glaesemann Subject: Re: Inserting a path into Database Date: Mon, 4 Jun 2007 16:15:21 -0500 To: Ranieri Mazili X-Mailer: Apple Mail (2.752.2) X-Chzlrs: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/360 X-Sequence-Number: 115183 On Jun 4, 2007, at 15:10 , Ranieri Mazili wrote: > I need to insert a path into a table, but because "\" I have a > error by postgres, so how can I insert a path like bellow into a > table: > > insert into production values ('C:\Program Files\My program'); In v8.0 and later you can use dollar-quoted strings, e.g., select $_$C:\Program Files\My program$_$; ?column? ----------------------------- C:\Program Files\My program http://www.postgresql.org/docs/8.2/interactive/sql-syntax- lexical.html#SQL-SYNTAX-DOLLAR-QUOTING For 8.2, you can turn on standard_conforming_strings in postgresql.conf so \ will be treated literally: http://www.postgresql.org/docs/8.2/interactive/runtime-config- compatible.html#GUC-STANDARD-CONFORMING-STRINGS Michael Glaesemann grzm seespotcode net