Re: Is there any chance to get some kind of a result set sifting mechanism in Postgres? - Mailing list pgsql-hackers

From Isaac Morland
Subject Re: Is there any chance to get some kind of a result set sifting mechanism in Postgres?
Date
Msg-id CAMsGm5c+-F8WUSnV+vqFLTck+g_6Vr+b7qZEbAooWdHgag-A8w@mail.gmail.com
Whole thread Raw
In response to Is there any chance to get some kind of a result set sifting mechanism in Postgres?  (aa <ghevge@gmail.com>)
List pgsql-hackers
On Mon, 13 May 2024 at 04:40, aa <ghevge@gmail.com> wrote:
Hello Everyone!

Is there any chance to get some kind of a result set sifting mechanism in Postgres? 

What I am looking for is a way to get for example: "nulls last" in a result set, without having to call "order by" or having to use UNION ALL, and if possible to get this in a single result set pass.

Something on this line: SELECT a, b, c FROM my_table WHERE a nulls last OFFSET 0 LIMIT 25

I don't want to use order by or union all because these are time consuming operations, especially on  large data sets and when comparations are done on dynamic values (eg: geolocation distances in between a mobile and a static location) 

This already exists: ORDER BY a IS NULL

I've found it to be more useful than one might initially expect to order by a boolean expression.

pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: Direct SSL connection with ALPN and HBA rules
Next
From: Matthias van de Meent
Date:
Subject: Re: WAL_LOG CREATE DATABASE strategy broken for non-standard page layouts