Folks,
Please find attached a patch for $Subject.
Motivation:
When people are doing keyset pagination, the simple cases redound to
adding a WHERE that looks like
(a, b, c) > (most_recent_a, most_recent_b, most_recent_c)
which corresponds to an ORDER BY clause that looks like
ORDER BY a, b, c
The fun starts when there are mixes of ASC and DESC in the ORDER BY
clause. Reverse collations make this simpler by inverting the meaning
of > (or similar), which makes the rowtypes still sortable in a new
dictionary order, so the pagination would look like:
(a, b, c) > (most_recent_a, most_recent_b COLLATE "C_backwards", most_recent_c)
with an ORDER BY like:
ORDER BY a, b DESC, c
What say?
Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate