From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul Lambert <paul.lambert@autoledgers.com.au>
Cc: pgsql-odbc@postgresql.org
Subject: Re: ODBC driver adding extra characters to table names.
Date: Wed, 08 Aug 2007 22:01:53 -0400
Message-ID: <11903.1186624913@sss.pgh.pa.us> (raw)
In-Reply-To: <46BA42E5.30407@autoledgers.com.au>
References: <46BA42E5.30407@autoledgers.com.au>
Paul Lambert <paul.lambert@autoledgers.com.au> writes:
> for example, the psqlodbc_<pid>.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: tgl@sss.pgh.pa.us, paul.lambert@autoledgers.com.au
Subject: Re: ODBC driver adding extra characters to table names.
In-Reply-To: <11903.1186624913@sss.pgh.pa.us>
References: <46BA42E5.30407@autoledgers.com.au> <11903.1186624913@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox