X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id 26940D1C953 for ; Tue, 22 Jul 2003 14:03:50 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 03736-05 for ; Tue, 22 Jul 2003 14:03:39 +0000 (GMT) Received: from head-cfa.cfa.harvard.edu (head-cfa.cfa.harvard.edu [131.142.41.8]) by svr1.postgresql.org (Postfix) with ESMTP id D8D86D1C508 for ; Tue, 22 Jul 2003 11:03:38 -0300 (ADT) Received: from head-cfa.harvard.edu (artemis [131.142.42.189]) by head-cfa.cfa.harvard.edu (8.12.8p1/8.12.8) with ESMTP id h6ME3Oxj007225; Tue, 22 Jul 2003 10:03:24 -0400 (EDT) Message-Id: <200307221403.h6ME3Oxj007225@head-cfa.cfa.harvard.edu> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Tom Lane Cc: Bruce Momjian , Jean-Luc Lachance , "Michael S. Tibbetts" , pgsql-sql@postgresql.org Subject: Re: min() and NaN In-reply-to: Message from Tom Lane of "Tue, 22 Jul 2003 02:09:09 -0400." <4074.1058854149@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 22 Jul 2003 10:03:24 -0400 From: Michael Tibbetts X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/332 X-Sequence-Number: 14446 Treating NaN's as larger(or smaller) than all ordinary values seems a fine way to go. It avoids the situation where you request MIN and get an ordinary value which is greater than the minimum ordinary value in the table. If MIN(or MAX given the ordering you're suggesting) returns NaN, the user would stand better odds of figuring out that something about the query needs to be changed. Returning an plausible, though possibly incorrect, ordinary value from MIN or MAX if there are NaN's in the column can lead users to make some unfortunate mistakes(voice of experience?). Thanks for your help, Mike > Bruce Momjian writes: > > Is this a TODO? > > It'll only take ten minutes to make it a DONE, once we figure out what > the behavior ought to be. So far I think both Stephan and I argued that > MIN/MAX ought to treat NaN as larger than all ordinary values, for > consistency with the comparison operators. That was not the behavior > Michael wanted, but I don't see that we have much choice given the > wording of the SQL spec. Does anyone want to argue against that > definition? > > regards, tom lane