Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5E80FE63450 for ; Thu, 14 Jun 2001 04:00:15 -0400 (EDT) (envelope-from Inoue@tpf.co.jp) Received: (qmail 9230 invoked from network); 14 Jun 2001 08:00:12 -0000 Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108) by sd2.10.0.100.in-addr.arpa with SMTP; 14 Jun 2001 08:00:12 -0000 Received: from tpf.co.jp ([126.0.1.68]) by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id RAA24761; Thu, 14 Jun 2001 17:00:00 +0900 (JST) Message-ID: <3B286F3C.1F31F39F@tpf.co.jp> Date: Thu, 14 Jun 2001 17:01:00 +0900 From: Hiroshi Inoue X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U) X-Accept-Language: ja MIME-Version: 1.0 To: "mascarm@mascari.com" CC: "'Tom Lane'" , "'Tom Ivar Helbekkmo'" , Stephan Szabo , Mark Stosberg , "pgsql-hackers@postgresql.org" Subject: Re: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Standards References: <01C0F00D.8A800260.mascarm@mascari.com> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Archive-Number: 200106/418 X-Sequence-Number: 10041 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