scribase
Data typesversion 1.1on by default

uuid-ossp

UUID generators (v1 to v5).

What it is for

uuid-ossp generates UUIDs of versions 1, 3, 4 and 5. For random v4 values the built-in gen_random_uuid() is enough; reach for uuid-ossp when you need name-based v5 UUIDs that are the same every time for the same input.

Enable it

sql
create extension if not exists "uuid-ossp" with schema extensions;

Example

sql
select uuid_generate_v4();

-- the same input always gives the same v5 UUID
select uuid_generate_v5(uuid_ns_url(), 'https://example.com/products/42');

Questions

How do I enable uuid-ossp?

Run create extension if not exists "uuid-ossp" with schema extensions; in the SQL editor, or switch it on from the Extensions page in the console. You do not need superuser access.

Which version of uuid-ossp is installed?

1.1, on Postgres 17.6, as read from the running engine on 2026-10-08. Check yours with: select extversion from pg_extension where extname = 'uuid-ossp';

Upstream project: www.postgresql.org/docs/17/uuid-ossp.html

More data types extensions

  • pg_uuidv7 Time-ordered UUID v7 values.
  • citext Case-insensitive text, for emails and user names.
  • hstore Key-value pairs in one column.
  • ltree Tree paths such as categories and org charts.
  • intarray Functions and indexes for integer arrays.
  • cube Multi-dimensional points and boxes.