Let say we have two tables, where one refs on other
db.define_table('first', Field('name'))
db.define_table('second',Field('first','reference first')
If first table populated with data, and sometimes DB rejects inserts bc of some constrains, but id will count up and on next insert gap appears.
export_to_csv_file will generate files with id, but import_from_csv_file ignores id column creating them automatically.
If necessary, I will create a test_app to reproduce the issue.