News for hackers. Stuff that matters.
Re:PostgreSQL and UUID as Primary Key by paulddraper on Saturday July 06, 2024 @03:14AM (#40888701)
The problems from unnecessary bigserial is nothing compared to the pain of insufficient serial.

This is especially true for PostgreSQL which increments sequences for upserts (even if no records are inserted).

That's how I've hit 32-bit limits on tables that had only a couple million rows.

---

I would only use 32-bit for very selective items that is used in a lot of FKs, like a tenant ID.

Re:PostgreSQL and UUID as Primary Key by vbezhenar on Saturday July 06, 2024 @05:45PM (#40893547)
I didn't know about upserts incrementing sequence. That makes sense. I don't think I ever used upsert, but that's a good reason to use bigint id (or at least make update count a factor to consider), thanks for pointing out.