logoalt Hacker News

andaiyesterday at 11:30 PM2 repliesview on HN

In the first example, there's a a second thing that surprised me: you delete an entity and it's unique ID gets reused? Is that a good idea?

I guess if foreign keys are handled properly then that's not a problem by definition? But it sounds wrong somehow.


Replies

bruce511today at 2:41 AM

>> you delete an entity and it's unique ID gets reused? Is that a good idea?

That's default behavior, but it can be altered when creating a table. See;

https://sqlite.org/autoinc.html

deepsuntoday at 12:51 AM

I think that's a security vulnerability.

If a parent table ID gets reused, then it's a potential to expose data to a wrong user -- security broked.