PostgreSQL: Using MIN/MAX on UUID columns - Italo Baeza Cabrera - Medium

I had a little beef with PostgreSQL recently. I love the database engine, but I came to understand no every database is perfect, like in this case. Due to some client’s circumstances, they’re tightly…

Medium

@darkghosthunter The standard way to select the max uuid with Postgres "out of the box" would be

SELECT id, [other columns] FROM table ORDER BY id FETCH FIRST ROW ONLY;

and ORDER BY id DESC would get the min.

@DanielVerite Both are practically the same, but if you're using Laravel there is no negotiation.