https://github.com/ivanyu/pg-uuids-v1-compare
PostgreSQL function to compare version 1 (time-based) UUIDs by timestamps and counter, and tests for it
https://github.com/ivanyu/pg-uuids-v1-compare
blog-post postgresql uuid
Last synced: 2 months ago
JSON representation
PostgreSQL function to compare version 1 (time-based) UUIDs by timestamps and counter, and tests for it
- Host: GitHub
- URL: https://github.com/ivanyu/pg-uuids-v1-compare
- Owner: ivanyu
- License: mit
- Created: 2016-03-20T19:46:01.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-28T11:06:52.000Z (over 10 years ago)
- Last Synced: 2025-02-01T20:13:09.693Z (over 1 year ago)
- Topics: blog-post, postgresql, uuid
- Language: Scala
- Homepage: https://ivanyu.me/blog/2016/03/28/time-based-version-1-uuids-ordering-in-postgresql/
- Size: 9.77 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pg-uuids-v1-compare
PostgreSQL function to compare version 1 (time-based) UUIDs based on timestamps, and tests for it.
**Example:**
```
SELECT uuids_v1_compare(uuid('762ca430-eed5-11e5-8ca8-4bebdf3c407a'),
uuid('762cf250-eed5-11e5-8ca8-4bebdf3c407a'))
uuids_v1_compare
smallint
----------------
-1
```
[A blog post](https://ivanyu.me/blog/2016/03/28/time-based-version-1-uuids-ordering-in-postgresql/) about it.