Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 60B48475E26 for ; Fri, 15 Nov 2002 14:00:13 -0500 (EST) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by postgresql.org (Postfix) with ESMTP id 4721F475B8F for ; Fri, 15 Nov 2002 14:00:06 -0500 (EST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 18ClhC-0000rE-0U; Fri, 15 Nov 2002 19:00:02 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 01E1A16927; Fri, 15 Nov 2002 18:48:39 +0000 (GMT) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 5DBA516926; Fri, 15 Nov 2002 18:48:38 +0000 (GMT) Content-Type: text/plain; charset="utf-8" From: Richard Huxton Organization: Archonet Ltd To: "Vaughn Cleminson" , pgsql-sql@postgresql.org Subject: Re: Does Postgres replace \\ with \ in an update query Date: Fri, 15 Nov 2002 18:48:35 +0000 User-Agent: KMail/1.4.3 References: <3dd4a0e4.0@news1.mweb.co.za> In-Reply-To: <3dd4a0e4.0@news1.mweb.co.za> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211151848.35639.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/232 X-Sequence-Number: 10374 On Friday 15 Nov 2002 7:23 am, Vaughn Cleminson wrote: > Hi All > > I am doing a normal SQL update against postgres. > Seems to be replacing \\ with \ when it gets saved in the database. eg. > \\machine\folder is being replaced with \machine > > Any ideas? The backslash (\) character is used to escape other characters from normal= =20 interpretation, so you can have a text value: 'Richard\'s text' which means= =20 during processing the backslash is removed. If you want to actually have a backslash in your sql you'll need to escape = it=20 too. So you'll have something like: INSERT INTO foo (path) VALUES ('\\\\machine\\folder'); Most application languages offer something like a quote_sql() function whic= h=20 handles all the details of this for you. --=20 Richard Huxton