PGConf.EU 2025 in Berlin brought together core PostgreSQL contributors and database practitioners for four days of talks, workshops, and unconference sessions. UUID v7 was a recurring theme across the database design, performance, and migration tracks — driven by the pending PostgreSQL 18 release with native uuidv7() support. See PostgreSQL 18 Native UUID v7 for the full feature overview.

Session: PostgreSQL 18 UUID v7 built-ins

A core contributor previewed the two new PG 18 UUID functions:

-- PostgreSQL 18: built-in UUID v7 generation
SELECT uuidv7();
-- 018fbe3a-4c5d-7b12-8f3e-1a2b3c4d5e6f

-- Extract the embedded millisecond timestamp
SELECT uuid_extract_timestamp('018fbe3a-4c5d-7b12-8f3e-1a2b3c4d5e6f');
-- 2026-10-15 14:23:01.234+00

-- Version and variant extraction
SELECT uuid_extract_version('018fbe3a-4c5d-7b12-8f3e-1a2b3c4d5e6f');  -- 7

-- Upgrade existing table default in one statement
ALTER TABLE orders
  ALTER COLUMN id SET DEFAULT uuidv7();

The session noted that uuid_extract_timestamp() works on any RFC 9562 UUID with an embedded timestamp — including UUID v1 and v6 — making it a general-purpose timestamp extractor. See UUID Epoch for the timestamp format.

Session: Zero-downtime migration from UUID v4

A practitioner from a Berlin fintech company presented their 180M-row migration from UUID v4 to UUID v7:

Week-by-week timeline:

-- Week 1: add UUID v7 column with default
ALTER TABLE payments ADD COLUMN id_v7 uuid DEFAULT uuidv7();

-- Weeks 2–4: background backfill (batched, low-rate)
UPDATE payments
SET id_v7 = uuidv7()
WHERE id_v7 IS NULL
  AND id IN (
    SELECT id FROM payments WHERE id_v7 IS NULL LIMIT 8000
  );

-- Week 5: concurrent index (non-blocking)
CREATE INDEX CONCURRENTLY idx_payments_id_v7 ON payments (id_v7);

-- Week 6: update FK columns in child tables (3 child tables)
UPDATE payment_items SET payment_id_v7 = payments.id_v7
FROM payments WHERE payment_items.payment_id = payments.id;

-- Week 7: PK swap (fast transaction)
BEGIN;
ALTER TABLE payments DROP CONSTRAINT payments_pkey;
ALTER TABLE payments ADD PRIMARY KEY USING INDEX idx_payments_id_v7;
COMMIT;
-- ↑ 380ms on 180M rows

Outcome: Write throughput increased 2.8× after migration. The speaker recommended always migrating foreign key columns before the PK swap. See Zero-Downtime UUID Migration.

Session: Multi-tenant primary key design with UUID v7

-- Pattern: UUID v7 per-tenant for row isolation
-- tenant_id (UUID v4, stable) + id (UUID v7, time-ordered within tenant)

CREATE TABLE events (
  tenant_id uuid        NOT NULL,
  id        uuid        NOT NULL DEFAULT uuidv7(),
  payload   jsonb       NOT NULL,
  PRIMARY KEY (tenant_id, id)  -- composite: tenant prefix, UUID v7 suffix
);

-- Efficient per-tenant time-range query
SELECT * FROM events
WHERE tenant_id = 'a8098c1a-...'
  AND id >= uuidv7_from_timestamp(now() - interval '1 hour')
ORDER BY id
LIMIT 100;

The composite primary key keeps tenant data physically co-located in the B-tree, and UUID v7’s monotonicity ensures new rows are always appended to the right end of each tenant’s partition. See UUID v7 in Multi-Tenant SaaS.

Workshop: pg_uuidv7 to PostgreSQL 18 upgrade path

The hands-on workshop covered migrating from the pg_uuidv7 extension to the native PG 18 function:

-- Before (pg_uuidv7 extension):
-- uuidv7() is provided by the extension
SELECT uuidv7();  -- works with extension loaded

-- After (PostgreSQL 18 native):
-- DROP EXTENSION pg_uuidv7;  -- only after upgrading to PG 18
-- uuidv7() is now built-in, no extension needed

-- Migration: no schema changes needed
-- The function signature is identical
-- Just DROP EXTENSION after upgrading

Further reading

External references

Frequently asked questions

What UUID v7 features were announced for PostgreSQL 18 at PGConf.EU 2025?

Speakers previewed the then-upcoming PostgreSQL 18 built-in uuidv7() function and uuid_extract_timestamp(), which extracts the millisecond timestamp from a UUID v7 value. Sessions demonstrated that existing tables using gen_random_uuid() can migrate to uuidv7() with a single ALTER TABLE ... ALTER COLUMN id SET DEFAULT uuidv7() statement once on PG 18. See PostgreSQL 18 Native UUID v7.

What zero-downtime migration patterns were covered at PGConf.EU 2025?

The main migration talk covered the dual-column approach: add id_v7 uuid DEFAULT uuidv7(), backfill existing rows in batches of 5,000–10,000 with a pause between batches, run CREATE INDEX CONCURRENTLY, update foreign key columns in child tables, then swap the primary key in a single short transaction. Speakers cited PK swap times of under 400ms on tables up to 200M rows. See Zero-Downtime UUID Migration.