PostgreSQL function to compare version 1 (time-based) UUIDs by timestamps and counter, and tests for it