In your SELECT INTO you can't create a fake id field with a custom sequence just for the new table or better use the id field of the quered table? web2py doesn't need the field to be serial type it just need a integer field I think so when you define your model just tell web2py that the field is the id field...
Richard On Wed, Jun 13, 2012 at 2:24 AM, Johann Spies <[email protected]>wrote: > On 12 June 2012 18:33, Richard Vézina <[email protected]> wrote: > >> Not sure if it will answer your question, but to me if I need to do that >> I will do db.executesql for the SELECT INTO and reflect this change into a >> a dynamic table definition... >> >> db.define_table(..., migrate=True) >> >> The drawback is that the db.define_table will stay dynamic even if the >> table into postgres is permanent. >> >> >> > The problem is that such a table will not have a sequence-based id-field > because it is the result of a query. As I understand it, web2py requires > such a field to be able to use DAL. > > Regards > Johann > -- > Because experiencing your loyal love is better than life itself, > my lips will praise you. (Psalm 63:3) > >

