When would you ever want NULLS first when ordering a query descending or ascending?
In my opinion, the vast majority of the time the desired behavior whether sorting ascending or descending would be NULLS LAST. Instead, we should have to specify NULLS FIRST.
The simple answer is because that's how the people who wrote Postgres designed it. To quote:
This assumes that you have specified an ORDER BY clause, if you haven't then the rows are returned randomly.
Actually, with default sort order (
ASCENDING
) NULL values come last.Logic dictates that the sort order be reversed with the
DESCENDING
keyword, so NULLs come first in this case.But the best part comes last: you can choose which way you want it:
NULLS FIRST | LAST
clause.Quoting the current manual, version 9.3 as of writing:
Bold emphasis mine.