Hi,
I keep on investigating on the "death postgres" subjectbut open a new thread as I don't know if it's related to my pb.
I have 2 different clusters, on 2 different machines, one is prod, the second test.Same data volumes.
On prod if I doselect col_a, count(col_a) from table_a group by col_a order by col_a desc,I get the numbers of NULL on top.To get the number of NULL on top on the test db, I have toselect col_a, count(col_a) from table_a group by col_a order by col_a asc.
This doesn't answer your question, but: ORDER BY has NULLS { FIRST | LAST } options, so no need to completely change the sort order.
And this just confuses your question:
https://www.postgresql.org/docs/15/sql-select.html
IfNULLS LAST
is specified, null values sort after all non-null values; ifNULLS FIRST
is specified, null values sort before all non-null values. If neither is specified, the default behavior isNULLS LAST
whenASC
is specified or implied, andNULLS FIRST
whenDESC
is specified (thus, the default is to act as though nulls are larger than non-nulls).
--
Born in Arizona, moved to Babylonia.
Born in Arizona, moved to Babylonia.