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 CE698D1C508 for ; Tue, 22 Jul 2003 19:00:12 +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 85785-05 for ; Tue, 22 Jul 2003 15:59:27 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id B2602D1C4DC for ; Tue, 22 Jul 2003 16:00:07 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h6MIxJk11503; Tue, 22 Jul 2003 14:59:19 -0400 (EDT) From: Bruce Momjian Message-Id: <200307221859.h6MIxJk11503@candle.pha.pa.us> Subject: Re: min() and NaN In-Reply-To: <20030722112906.M39399-100000@megazone.bigpanda.com> To: Stephan Szabo Date: Tue, 22 Jul 2003 14:59:19 -0400 (EDT) Cc: Tom Lane , 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/326 X-Sequence-Number: 14440 Stephan Szabo wrote: > > 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. But maybe that logic is the same as ORDER BY, where we have to give it some location in sorting order, while with aggregates we don't. I am not strong on this, but just point it out. -- 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