Sounds like the problem is with how you inserted the data into the DB. To get the data out is pretty easy: records = db(db.plugin_seq.id>0).select()
Any extraneous data is already in the database. To fix that you either need to fix the insertion process or strip out the extraneous data after obtaining the records.