You can define your tables manually via SQL, and disable web2py migrations.
I don't think you can redefine a table in web2py, and it would be
"counter-productive" anyway.
Circular references may work in SQLite as it does little for
consistency and data integrity, but postgresql is strict, you should
first create all the tables, insert initial data, then add foreing key
constraints.
I think this is not yet supported automatically in web2py, but you can
find workarounds easily.
Best regards,
Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com
Anyway, there is no easy way in PostgreSQL (and possibly other "real"
databases too) to create circular references the way web2py does,
you'll need to execute SQL to properly create tables, populate them
and create foreing key constraints.
You can use db.executesql for this, and look for a standard postgresql
backup to see the required commands and correct steps.
Best regards,
Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com