I agree it would be better to use psycopg2, but that may not be the source 
of your issue. It looks like the database tables already exist, but your 
web2py installation doesn't know it so is attempting to create the tables 
again. You can temporarily set fake_migrate_all=True, which will generate 
the *.table metadata files in the /databases folder without actually 
running the migrations. Then web2py will know the tables already exist and 
will not attempt to create them. You can also simply disable migrations 
altogether, though in that case, changes to your models will not trigger 
the necessary migrations.

Anthony

On Friday, August 11, 2017 at 10:44:59 AM UTC-4, Richard wrote:
>
> Use : psycopg2
>
> pg8000 has known issues...
>
> Richard
>
> On Fri, Aug 11, 2017 at 10:42 AM, <shazianu...@gmail.com> wrote:
>
>> Hi,
>>
>> I am new user to web2py and I copied repo from an existing project from 
>> AWS. With following settings I need to make it work on local server so I 
>> can make few changes but I am stuck at database error. Please guide me as I 
>> have little knowledge about how to drop tables and make it work.
>>
>> if not request.env.web2py_runtime_gae:
>>     # ---------------------------------------------------------------------
>>     # if NOT running on Google App Engine use SQLite or other DB
>>     # ---------------------------------------------------------------------
>>     db = DAL(myconf.get('db.'+myconf.get('db.mode')+'_uri'),
>>              pool_size=myconf.get('db.pool_size'),
>>              migrate=myconf.get('db.migrate'),
>>              migrate_enabled=myconf.get('db.migrate_enabled'),
>>              fake_migrate_all=myconf.get('db.fake_migrate_all'),
>>              check_reserved=['all'])
>> else:
>>
>>     #db = DAL('google:datastore+ndb')
>>     db = DAL('sqlite://storage.sqlite', pool_size=1, check_reserved=['all'], 
>> migrate=False)
>>     session.connect(request, response, db=db)
>>
>>
>> Error I get from these settings on local server is:
>>
>> <class 'gluon.contrib.pg8000.ProgrammingError'>(('ERROR', '42P07', 
>> 'relation "auth_user" already exists'))
>>
>> Please advise.
>>
>> -- 
>> 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 web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to