HN2new | past | comments | ask | show | jobs | submitlogin

> Postgres can auto generate UUIDs too and can be used for pk

True, but the practice makes it easier to shift to the dark side and insert the child records first, as you can already know the pk of the parent record in advance.



How can you do that when you have fkeys in your database design like a good engineer, right? Right?


> How can you do that when you have fkeys in your database design like a good engineer, right? Right?

I know you are trolling, and it is ok if done sensibly, but it is not simply purism that makes it a bad idea. Because you have to trust the client it opens the way to discovery attacks (try inserting a record with a specific PK -> it will fail if the record exists -> now you know that it exists even if you don't have access to that record).

You may also not have access to all client implementations (think of public APIs) so some client libraries might not implement proper (i.e. strongly random) UUID generation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: