X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 71327562EF; Sat, 12 Mar 2005 09:32:12 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71045-07; Sat, 12 Mar 2005 09:31:54 +0000 (GMT) Received: from quasar.skima.is (quasar.skima.is [212.30.200.205]) by svr1.postgresql.org (Postfix) with ESMTP id 5E32956510; Sat, 12 Mar 2005 09:31:52 +0000 (GMT) Received: from gnari ([157.157.184.242] [157.157.184.242]) by quasar.skima.is with ESMTP; Sat, 12 Mar 2005 09:31:52 Z Subject: Re: [JDBC] MS Access to PostgreSQL From: Ragnar =?ISO-8859-1?Q?Hafsta=F0?= To: Brian Gunning Cc: 'Shelby Cain' , pgsql-novice@postgresql.org, pgsql-general@postgresql.org, pgsql-jdbc@postgresql.org In-Reply-To: References: Content-Type: text/plain Date: Sat, 12 Mar 2005 09:35:46 +0000 Message-Id: <1110620146.28803.9.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/501 X-Sequence-Number: 74816 On Fri, 2005-03-11 at 17:52 +0000, Brian Gunning wrote: [rearranged quoting] > From: pgsql-jdbc-owner@postgresql.org > --- William Shatner wrote: > > I have recently migrated from MS Access to > > PostgreSQL.Previously I had > > a SQL command > > > > ResultSet aGroupResultSet = > > aGroupPathStmt.executeQuery( > > "SELECT \"groupID\",\"fullpath\" FROM > > \"groups\" WHERE > > \"fullpath\" Like '" + > > aPath + "'"); > > > > > > where aPath was equal to 'folder\another folder\%'. > > > I don't think the problem isn't with the backslashes. They are escaped and > seem to be working fine e.g. to insert a backslash in Access I had to use > one escape character ('\\') whereas in PostgreSQL four backslashes ('\\\\') > are required. The line that inserts the % is as follows... > > String aPath = group.getPath() + aOldGroupName + "\\%"; are the backslashes in group.getPath() + aOldGroupName escaped ? does aGroupPathStmt.executeQuery() escape backslashes ? did you print the SQL statement to screen or logfile to make sure what is actually sent to executeQuery() ? does your language support placeholders ? this kind of problems are usually easier to deal with with them. gnari