Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id CFC079FBF6A for ; Wed, 8 Aug 2007 23:02:11 -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 13173-02 for ; Wed, 8 Aug 2007 23:02:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 863339FBF5F for ; Wed, 8 Aug 2007 23:02:08 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l7921rc6011904; Wed, 8 Aug 2007 22:01:54 -0400 (EDT) To: Paul Lambert cc: pgsql-odbc@postgresql.org Subject: Re: ODBC driver adding extra characters to table names. In-reply-to: <46BA42E5.30407@autoledgers.com.au> References: <46BA42E5.30407@autoledgers.com.au> Comments: In-reply-to Paul Lambert message dated "Thu, 09 Aug 2007 06:25:41 +0800" Date: Wed, 08 Aug 2007 22:01:53 -0400 Message-ID: <11903.1186624913@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/17 X-Sequence-Number: 9134 Paul Lambert writes: > for example, the psqlodbc_.log file has the following when I > attempt to link a table called billing_code: > select n.nspname, c.relname, a.attname, a.atttypid, t.typname, a.attnum, > a.attlen, a.atttypmod, a.attnotnull, c.relhasrules, c.relkind, c.oid, > d.adsrc from (((pg_catalog.pg_class c inner join pg_catalog.pg_namespace > n on n.oid = c.relnamespace and c.relname like 'billing\\_code' and > n.nspname like 'public') inner join pg_catalog.pg_attribute a on (not > a.attisdropped) and a.attnum > 0 and a.attrelid = c.oid) inner join > pg_catalog.pg_type t on t.oid = a.atttypid) left outer join pg_attrdef d > on a.atthasdef and d.adrelid = a.attrelid and d.adnum = a.attnum order > by n.nspname, c.relname, attnum' > Note the 'billing\\_code' in there. > If I run this query in psql I get no rows. If I change it to > 'billing\_code' or 'billing_code' (taking out one or both of the > backslashes) I get the table details. It sounds like you have standard_conforming_strings turned ON (making backslashes not special in string literals) but there is some part of the client-side code that is not aware of that, and thinks it needs to double the backslash in the LIKE pattern. Either turn off standard_conforming_strings or make sure you are using code that is new enough to cope. regards, tom lane