UUIDv7 Comes to PostgreSQL 18

https://www.thenile.dev/blog/uuidv7
webpage banner

UUIDv7 Comes to PostgreSQL 18

This article discusses the introduction of native support for UUIDv7 in PostgreSQL 18, highlighting its benefits as a timestamp-based UUID variant that improves index locality and sortability compared to previous UUID versions. It explains why UUIDs are useful as primary keys in distributed databases, for unguessable public identifiers, and for allowing clients to generate identifiers without server coordination. The post also details how UUIDv7 addresses common concerns regarding UUIDs in databases, such as sorting and index locality, making it a significant enhancement for database design.

Note

postgres is one amazing engine that just keeps on rolling.

uuids are a fantastic tool to leverage and it's fun to travel down the history of v1 through v8.

I wonder if folks will try and utilize creation time from the uuid directly or continue to use a separate field. conversely, i wonder if some teams find this information one they wouldn't want to leak...

Published

2025

Summary

This article discusses the introduction of native support for UUIDv7 in PostgreSQL 18, highlighting its benefits as a timestamp-based UUID variant that improves index locality and sortability compared to previous UUID versions. It explains why UUIDs are useful as primary keys in distributed databases, for unguessable public identifiers, and for allowing clients to generate identifiers without server coordination. The post also details how UUIDv7 addresses common concerns regarding UUIDs in databases, such as sorting and index locality, making it a significant enhancement for database design.

Image

Image for UUIDv7 Comes to PostgreSQL 18