Skip site navigation (1) Skip section navigation (2)

Re: ODBC SELECT WHERE a IN ('frob') returns where a = '' too

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adam Haberlach <adam(at)newsnipple(dot)com>
Cc: bugs(at)postgresql(dot)org
Subject: Re: ODBC SELECT WHERE a IN ('frob') returns where a = '' too
Date: 2000-05-23 05:33:56
Message-ID: 560.959060036@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Adam Haberlach <adam(at)newsnipple(dot)com> writes:
> When I do a query of the form
> SELECT a FROM tbl WHERE a IN ('frob');
> where a is an indexed text field containing 'frob', 'dingus', '', and 
> NULL
> I get a set that includes rows both where
> a == 'frob'
> a == ''

> This happens when I use ODBC from Microsoft Access's pass-through, but 
> does not seem to happen from the psql
> command-line.  This seems to confuse my coworker who is more familiar 
> with non-Postgres databases then I.

I'm confused too.  Best theory I can think of is that Access is
transforming the query into something different before sending it to the
backend.  That'd be incredibly braindead, but then this is M$ software
we're talking about.  Anyway, the first thing to do is confirm or deny
that theory by looking at the exact query the backend is getting.
If you can't get Access to log what it sends, restart the postmaster
with "-d2" or higher, and see what gets logged...

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2000-05-23 06:03:53
Subject: Re: pg_dump crashes trying to dump database containing index on oid
Previous:From: Adam HaberlachDate: 2000-05-23 05:31:49
Subject: ODBC SELECT WHERE a IN ('frob') returns where a = '' too

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group