I can't think of any major issues given that you don't care about collisions. But here are some small considerations:
Developer ergonomics:
If all your other tables have a normal incrementing id column, as they usually do in Rails projects, consistency may be nice. Otherwise this table will be the one exception where internal people looking at data have to order by created_at
instead of by id
. Debugging also becomes more difficult when you can't easily query the next and previous items.
The solution here would be to have a separate unique column with an index, and that one is exposed to the users. This could be some sort of random integer, or integers separated by hyphens like Amazon order ids.
Style:
If one user's id is 5 and another user's id is 999,999,999,999 then your UI will have to make both sizes look nice. It will also be noticeably odd to the user who has two objects with wildly different ids.
At a company I worked for we had our receipt ids look more like BGTM-ZIJL-52 (always 4/4/2) for consistency. (We also had to make sure we never generated rude words.)
Imported data:
Let's say you are storing order numbers from people's purchases, and you merge with another company and want to import their orders into your system. It would be easier to do that if you had a separate but flexible column for public ids (i.e. a varchar), so that it will support the other company's ids no matter what style they chose (unless there are collisions with yours).
Asides: You're probably aware of this, but you can of course retry inserting a row if you get a collision. There's no need for your app to fail. You could also have PostgreSQL generate the random-seeming ids: https://stackoverflow.com/a/20890246