4 ms·
I'd consider using generated as identity instead of serial in postgres. https://www.2ndquadrant.com/en/blog/postgresql-10-identity-columns/ https://www.2ndquad
by CodesInChaos 5y ago
I'd consider using generated as identity instead of serial in postgres.
https://www.2ndquadrant.com/en/blog/postgresql-10-identity-columns/ https://www.2ndquadrant.com/en/blog/postgresql-10-identity-c...
And if any of your tables might grow beyond 2B rows, I'd use 64-bit IDs (serial8) from the start to avoid an expensive migration later.
- ttfkam 5y agoSequential UUIDs: safer for avoiding errant results from mistyped joins and better clustered database support down the line while keeping good performance levels. https://www.2ndquadrant.com/en/blog/sequential-uuid-generators/ https://www.2ndquadrant.com/en/blog/sequential-uuid-generato... "I say we take off and nuke the whole sequence-generated id installation from orbit. It's the only way to be sure." – Ellen 'SQL' Ripley