Re: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Standards

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: "mascarm(at)mascari(dot)com" <mascarm(at)mascari(dot)com>
Cc: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'Tom Ivar Helbekkmo'" <tih(at)kpnQwest(dot)no>, Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, Mark Stosberg <mark(at)summersault(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Standards
Date: 2001-06-14 08:01:00
Message-ID: 3B286F3C.1F31F39F@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mike Mascari wrote:
>
> > > The best solution would be to have the ODBC translate instances
> of '=
> > > NULL' into IS NULL before submitting the query to PostgreSQL.
>
> Tom Lane wrote:
>
> > Does Access only talk to Postgres via ODBC? (Seems plausible, but
> I
> > don't know.) What about people copying-and-pasting queries
> generated
> > by Access; is it even possible?
>
> 1. Yes, Access only talkes to Postgres via ODBC.
>
> 2. The queries generate by Access which use the '= NULL' vs. 'IS
> NULL' language are only generated through the use of Access Forms,
> when some attempts to fetch a record through the forms interface
> where the key of the linked table is an empty edit control. When
> access generates queries, it correctly generates 'IS NULL' language.
> It is a *very specific problem* WRT the user of Access Forms.
>

Could you send me an example using Access Forms ?
DAO seems to translate '= NULL' into 'IS NULL' properly.
Hmm parameter bindings( expr = ? ) could be the cause.

> > I doubt that this'd really help much, in any case; it merely moves
> the
> > necessary switch from the backend to ODBC.
>
> It seems to me that is where it belongs. The ODBC driver is already
> doing translation of some Access functions not found in PostgreSQL
> such as LCASE->lower, etc.

It doesn't seem that easy.
Detecting '= NULL' isn't sufficient.
'SET .. expr = NULL' mustn't be tranlated into
'SET .. expr IS NULL'. The '= NULL' must be inside
a where clause.
Unfortunately the current psqlodbc driver parses
little.

regards,
Hiroshi Inoue

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Michel POURE 2001-06-14 09:34:03 Re: SELECT Field1 || Field2 FROM Table
Previous Message Bruce Momjian 2001-06-14 05:05:51 Re: [PATCHES] Removal of temp tables