http://qs321.pair.com?node_id=1232287


in reply to Perl DBI and Foreign Keys

This may not be practical, but: do not tell the DB to create an autoincrement id for you. Instead give each new table an id YOU create and guaranteed to be unique. That will create you extra headaches: checking if the id you generated already exists in db, unless the generating algorithm guarantees no collisions given different table data. A random number generator does not guarantee uniqueness. How about creating such an id from millisecond time of insertion plus an autoincrement in case there are more than 1 insertions per millisecond. That wont work if you have more than 1 user entering data in parallel, unless you create an "autoincrement server" which is overkill.