To work around my earlier unicode problem (I submitted an issue on Github) 
I switched from the pg8000 adapter to the psycopg2 adapter for my postgre 
database. Everything works fine as long as I have migrate set to False. But 
if I set migrate=True I get this error:

    <class 'psycopg2.ProgrammingError'>(relation "auth_user" already exists 
)

This is strange because the dal shouldn't be trying to perform any 
migrations. Nothing in the model definitions or the db structure was 
changed. The only change was the db adapter. Thinking my .table files might 
have been corrupted, I tried doing a fake migrate by setting migrate=False 
and fake_migrate_all=True, then switching both values again. But nothing 
has changed. I'm still getting the same error as long as migrations are 
turned on.

Here's the full traceback:

Traceback (most recent call last):
 File "/home/ian/web/web2py-dev/gluon/restricted.py", line 227, in restricted
 exec ccode in environment
 File "/home/ian/web/web2py-dev/applications/paideia/models/db.py" 
<http://127.0.0.1:8000/admin/default/edit/paideia/models/db.py>, line 192, in 
<module>
 auth.define_tables() # creates all needed tables
 File "/home/ian/web/web2py-dev/gluon/tools.py", line 1893, in define_tables
 format='%(first_name)s %(last_name)s (%(id)s)'))
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/base.py", line 817, in 
define_table
 table = self.lazy_define_table(tablename,*fields,**args)
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/base.py", line 856, in 
lazy_define_table
 polymodel=polymodel)
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/base.py", 
line 463, in create_table
 self.create_sequence_and_triggers(query,table)
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/postgres.py", 
line 86, in create_sequence_and_triggers
 self.execute(query)
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/base.py", 
line 1326, in execute
 return self.log_execute(*a, **b)
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/base.py", 
line 1320, in log_execute
 ret = self.cursor.execute(command, *a[1:], **b)
ProgrammingError: relation "auth_user" already exists

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to