Can you add a print command
after command = a[0] I want to know what is the invalid command. The ticket only shows part if it. On Wednesday, 5 September 2012 17:27:49 UTC-5, Christian Espinoza wrote: > > Hi Massimo, this is: > > *File /opt/web-apps/web2py/gluon/dal.py in log_execute at line 1653* > Code listing > > 1648. > 1649. > 1650. > 1651. > 1652. > 1653. > > 1654. > 1655. > 1656. > 1657. > > command = a[0] > > if self.db._debug: > > logger.debug('SQL: %s' % command) > > self.db._lastsql = command > > t0 = time.time() > ret = self.cursor.execute(*a, **b) > > self.db._timings.append((command,time.time()-t0)) > > del self.db._timings[:-TIMINGSSIZE] > > return ret > > Variables a('SELECT auth_user.id, auth_user.username, auth_u...r.id > 0) > ORDER BY auth_user.id LIMIT 1 OFFSET 0;',) b > {}self<gluon.dal.PostgreSQLAdapter object>ret > undefined self.cursor<gluon.contrib.pg8000.dbapi.CursorWrapper > object>self.cursor.execute<bound > method CursorWrapper._fn of <gluon.contrib.pg8000.dbapi.CursorWrapper > object>> > > 2012/9/5 Massimo Di Pierro <massimo....@gmail.com <javascript:>> > >> Did you install psycopg2? If not it is probably using pg8000. Can you >> please help us debug? Edit dal.py and in the function log_excecute can you >> print the value of the command variable? What does it print when it fails? >> >> On Wednesday, 5 September 2012 11:29:42 UTC-5, Christian Espinoza wrote: >>> >>> Hello, I'm in trouble with a webapp that I'have. >>> >>> I develop it using sqlite only for a best approach of web2py features >>> with it. >>> >>> And I'm trying to migrate it to a Postgresql DB to put it on Testing >>> phase. >>> >>> But It doesn't work with PostgreSQL, only work with sqlite, I'd tried >>> with 1.99.7 - 2.0.6 - 2.0.7 Versions >>> >>> At 2.0.7 and 2.0.6 showme: <type 'exceptions.ValueError'> invalid >>> literal for int() with base 10: 'SELECT' >>> >>> At >>> >>> Traceback (most recent call last): >>> >>> File "/opt/web-apps/web2py/gluon/**restricted.py", line 209, in restricted >>> >>> exec ccode in environment >>> >>> File "/opt/web-apps/web2py-2.0.7/**applications/sadma/models/db.**py" >>> <https://172.16.1.34/admin/default/edit/sadma/models/db.py>, line 236, in >>> <module> >>> >>> if db(db.auth_user).isempty(): >>> >>> File "/opt/web-apps/web2py/gluon/**dal.py", line 8722, in isempty >>> >>> return not self.select(limitby=(0,1)) >>> >>> File "/opt/web-apps/web2py/gluon/**dal.py", line 8743, in select >>> >>> return adapter.select(self.query,fiel**ds,attributes) >>> >>> File "/opt/web-apps/web2py/gluon/**dal.py", line 1583, in select >>> >>> return self._select_aux(sql,fields,at**tributes) >>> >>> File "/opt/web-apps/web2py/gluon/**dal.py", line 1556, in _select_aux >>> >>> self.execute(sql) >>> >>> My Connection string: >>> >>> * #db = DAL('sqlite://storage.sqlite') >>> db = DAL('postgres://user:pass@localhost/dbapp')** >>> * >>> >>> *Running on Centos 6.0, external Postgresql Server with 9 version, **Python >>> 2.6.6* >>> >>> * >>> * >>> >>> Thanks in advance >>> >>> Christian. >>> >>> -- >> >> >> >> > > --