X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A83FED1C4DC for ; Tue, 22 Jul 2003 20:20:17 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 89578-04 for ; Tue, 22 Jul 2003 17:19:33 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 1CE69D1C4C1 for ; Tue, 22 Jul 2003 17:20:15 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h6MKJvP20649; Tue, 22 Jul 2003 16:19:57 -0400 (EDT) From: Bruce Momjian Message-Id: <200307222019.h6MKJvP20649@candle.pha.pa.us> Subject: Re: min() and NaN In-Reply-To: <15160.1058902399@sss.pgh.pa.us> To: Tom Lane Date: Tue, 22 Jul 2003 16:19:57 -0400 (EDT) Cc: Stephan Szabo , Jean-Luc Lachance , "Michael S. Tibbetts" , pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/328 X-Sequence-Number: 14442 Tom Lane wrote: > Bruce Momjian writes: > > Well, my 2 cents is that though we consider NULL when ordering via ORDER > > BY, we ignore it in MAX because it really isn't a value, and NaN seems > > to be similar to NULL. > > Good idea, but I don't think we can get away with it. The spec says > that MAX/MIN have to be consistent with the comparison operators (and > therefore with ORDER BY): > > iii) If MAX or MIN is specified, then the result is respec- > tively the maximum or minimum value in TXA. These results > are determined using the comparison rules specified in > Subclause 8.2, "". > > NULL can be special, because it acts specially in comparisons anyway. > But NaN is just a value of the datatype. > > I'd be willing to go against the spec if I thought that having > ignore-NaNs behavior was sufficiently important, but I don't think it's > important enough to disregard the spec... Yep. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073