Hi everyone,

For the current project I've got a requirement not to use plain SERIAL for the primary keys. The purpose is not to leak an important quantitative data. For example, when someone looks at the url "http://example.com/orders/12345", the "12345" identifier should not hint at the real amount of orders in the system.

After googling, I've found the following solution - sql - Replacing sequence with random number - Stack Overflow. I really like it, it does what I want in an elegant way. But the author says that he has not tried using it.

So, the question is - are there any possible pitfalls with this solution? Maybe there is a better alternative?