Bug #702: NULLs order by bug in 7.2.1

Started by PostgreSQL Bugs Listalmost 24 years ago3 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

John Liu (johnl@emrx.com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
NULLs order by bug in 7.2.1

Long Description
select date_fld from my_table order by date_fld desc;

The above query put NULLs on top of normal values
in stead of bottom, this is not the case in 7.1.3.
I thought Tom made some
fixes on this in 7.2 for order by.
Please provide us a fix patch suggestion
if possible.

Sample Code

No file was uploaded with this report

#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #702: NULLs order by bug in 7.2.1

On Tue, 2 Jul 2002 pgsql-bugs@postgresql.org wrote:

John Liu (johnl@emrx.com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
NULLs order by bug in 7.2.1

Long Description
select date_fld from my_table order by date_fld desc;

The above query put NULLs on top of normal values
in stead of bottom, this is not the case in 7.1.3.

I think this was the bug fix. I read the applicable
section of the spec as saying that NULLs are treated
as either all greater or all less than non-null values
for order by, so if the nulls come at the end of an asc
order by, they come at the front of the desc one.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #702: NULLs order by bug in 7.2.1

pgsql-bugs@postgresql.org writes:

select date_fld from my_table order by date_fld desc;

The above query put NULLs on top of normal values
in stead of bottom, this is not the case in 7.1.3.

This is not a bug; it is an intentional change in behavior to conform
to SQL92. We are not going to change it back --- unless you can
convince us that our reading of the spec is incorrect.

regards, tom lane