Re: any way for ORDER BY x to imply NULLS FIRST in 8.3?

From: David Fetter <david(at)fetter(dot)org>
To: rihad <rihad(at)mail(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org, jgodoy(at)gmail(dot)com
Subject: Re: any way for ORDER BY x to imply NULLS FIRST in 8.3?
Date: 2007-11-10 09:00:51
Message-ID: 20071110090051.GP3910@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Nov 09, 2007 at 03:17:53PM +0400, rihad wrote:
> >Em Wednesday 07 November 2007 13:54:32 rihad escreveu:
> >>
> >>May I, as an outsider, comment? :) I really think of ASC NULLS
> >>FIRST (and DESC NULLS LAST) as the way to go. Imagine a last_login
> >>column that sorts users that have not logged in as the most
> >>recently logged in, which is not very intuitive. I vote for
> >>sort_nulls_first defaulting to false in order not to break bc.
> >
> >But then, when ordering by login date, you should use COALESCE and
> >infinity for them
> >(http://www.postgresql.org/docs/8.2/interactive/datatype-datetime.html)
>
> It's not an easy thing to do with for example Propel 1.2 ORM
> (written in PHP):
>
> $criteria->addDescendingOrderByColumn(myPeer::LAST_LOGIN); // no
> place to shove database-specific attributes in.
>
> which was my main point.

If your ORM is broken as above, either fix it or do something that
isn't broken.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christian Schröder 2007-11-10 09:33:50 Re: (Never?) Kill Postmaster?
Previous Message Joe Conway 2007-11-10 05:04:51 Re: [GENERAL] Crosstab Problems