pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jean-Luc Lachance <jllachan@nsd.ca>
Cc: Michael S. Tibbetts <mtibbetts@head-cfa.cfa.harvard.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: min() and NaN
Date: Tue, 22 Jul 2003 14:59:19 -0400 (EDT)
Message-ID: <200307221859.h6MIxJk11503@candle.pha.pa.us> (raw)
In-Reply-To: <20030722112906.M39399-100000@megazone.bigpanda.com>

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



view thread (17+ messages)  latest in thread

Message-ID: <200307221859.h6MIxJk11503@candle.pha.pa.us>
Permalink:  ../200307221859.h6MIxJk11503@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200307221859.h6MIxJk11503@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pgman@candle.pha.pa.us, sszabo@megazone.bigpanda.com, tgl@sss.pgh.pa.us, jllachan@nsd.ca, mtibbetts@head-cfa.cfa.harvard.edu
  Subject: Re: min() and NaN
  In-Reply-To: <200307221859.h6MIxJk11503@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox