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 926A9D1C950 for ; Tue, 22 Jul 2003 18:32:48 +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 84383-02 for ; Tue, 22 Jul 2003 15:32:03 -0300 (ADT) Received: from megazone.bigpanda.com (unknown [66.180.233.26]) by svr1.postgresql.org (Postfix) with ESMTP id 8DDE7D1C94D for ; Tue, 22 Jul 2003 15:32:46 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 19C4DD60F; Tue, 22 Jul 2003 11:32:37 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 0F7715C0D; Tue, 22 Jul 2003 11:32:37 -0700 (PDT) Date: Tue, 22 Jul 2003 11:32:36 -0700 (PDT) From: Stephan Szabo To: Bruce Momjian Cc: Tom Lane , Jean-Luc Lachance , "Michael S. Tibbetts" , Subject: Re: min() and NaN In-Reply-To: <200307221614.h6MGEfc23097@candle.pha.pa.us> Message-ID: <20030722112906.M39399-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/324 X-Sequence-Number: 14438 On Tue, 22 Jul 2003, Bruce Momjian wrote: > 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. > > When doing ORDER BY, we have to put the NULL value somewhere, so we put > it at the end, but with aggregates, we aren't required to put the NULL > somewhere, so we ignore it. Should that be the same for NaN? I just > don't see how we can arbitrarly say it is greater/less than other > values. But we already do. When doing a less than/greater than comparison, 'NaN' is considered greater than normal values which is different from NULL which returns unknown for both.