PostgreSQL, by default, considers NULLs to be the highest and therefore sorts them first for downstream queries and lasts for upstream ones.
You can change this behavior for each query or when creating an index by specifying "NULLS LAST" or "NULLS FIRST".
How can I use this in conjunction with Django ORM without the need for raw queries? That is, when I add something like qs.order_by("-publish_start") to my query_set, how can I define sorting for zeros? Or, alternatively, after declaring a field / index.
Carles barrobés
source share