UUID 生成
生成 1 到 100 个 UUID v4 标识符,可选去掉连字符、转为大写,并格式化为 JSON 或 SQL。
完全在浏览器中运行 — 粘贴的内容不会被上传。
UUID v4 由浏览器 crypto API 生成,随机但并不保密 —— 不要当作 API 密钥使用。
正在生成…UUID 参考
快速参考- 8-4-4-4-12
- 带连字符的 36 字符标准形式;不含连字符的十六进制形式为 32 字符。
- v4
- 122 位随机,因此无需协调也几乎不可能碰撞。
- v7
- 按创建时间排序的 UUID,能让数据库索引保持紧凑。
- 00000000-0000-0000-0000-000000000000
- nil UUID,用作显式空值。
- gen_random_uuid()
- PostgreSQL 13 以上的服务端默认值函数;MySQL 使用 UUID()。
- 不是密钥
- UUID 实际难以预测,但并不是令牌 —— 不要当作 API 密钥使用。
SQL 相关语法指南
全部 SQL 指南Postgres RLS 42P17: infinite recursion detected in policy
A policy on members that reads members re-enters itself. One security definer function with a pinned search_path ends the recursion and leaves the rest of the policy intact.
SQLPgBouncer Transaction vs Session Pooling: What Breaks
Port 6543 hands out a server connection per transaction, so prepared statements, SET, LISTEN and cursors stop behaving. Driver-level settings for each stack.
SQLZero-Downtime Postgres Migrations: lock_timeout and NOT VALID
One ALTER TABLE waiting behind a slow SELECT blocks every query that arrives after it. The timeout-retry loop, NOT VALID constraints and CONCURRENTLY index rules.
SQLPostgres JSONB Indexing: GIN vs Expression B-Tree
GIN answers containment, not equality, and an expression B-tree is the reverse. Choose by operator, match the expression exactly, and prove it with EXPLAIN.