Quick tip regarding running out of primary keys and postgresql.
posted: 27 Nov 2017
Don’t forget about the negatives.
That is if you haven’t resorted to them yet. The int type has a minimum value of -2147483648… Use them. This should give you enough time to conjure up a migration strategy to a type that will fit your needs. The Night the PostgreSQL IDs Ran Out.
Godspeed.