# Choosing a Postgres Primary Key

DevFeed: [Choosing a Postgres Primary Key](<https://devfeed.tech/articles/choosing-a-postgres-primary-key-339.md>)

Original publisher: [Read original article](<https://supabase.com/blog/choosing-a-postgres-primary-key>)

Author: Victor

Published: 2022-09-08T07:00:00Z

Content type: article

Language: en

Sources: [Supabase Blog](<https://devfeed.tech/sources/supabase-blog.md>)

Topics: [Databases](<https://devfeed.tech/topics/databases.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [complexity](<https://devfeed.tech/tags/complexity.md>), [database](<https://devfeed.tech/tags/database.md>), [identifier](<https://devfeed.tech/tags/identifier.md>), [ids](<https://devfeed.tech/tags/ids.md>), [postgres](<https://devfeed.tech/tags/postgres.md>)

## AI overview

This article examines how to choose a Postgres primary key, comparing natural and surrogate keys, numeric identifiers, random values, and UUIDs. It discusses identifier trade-offs and using Postgres sequences for auto-incrementing integer keys.

## Source excerpt

Turns out the question of which identifier to use as a Primary Key is complicated -- we're going to dive into some of the complexity and inherent trade-offs, and figure things out