Hi, I am trying to use PostgreSQL DAL interface with my project, but i'm having trouble with table references and insert/update/delete commands.
The system info: OS: GNU/Linux, web2py 1.99.2, PostgreSQL 8.4 I have tried the workaround posted by pbreit for a very similar problem: http://groups.google.com/group/web2py/browse_thread/thread/b9eb96cbb5dbbc3f/7590e311d57260d9 The tables are created first without references and after that the rest of the fields are added, so define_tables is called twice for each table. As of this point all tables are created without errors. Then I try to upload legacy records from a customized csv file. When running the insert commands web2py raises this exception: (insert commands include the id field number as argument) Traceback (most recent call last): File "/home/alan/gestionlibre_gui-hg/controllers/appadmin.py", line 172, in create config.session.record_id = config.session.db_table.insert(**config.session.form.vars) File "/home/alan/web2py/gluon/dal.py", line 4976, in insert return self._db._adapter.insert(self,self._listify(fields)) File "/home/alan/web2py/gluon/dal.py", line 890, in insert id = self.lastrowid(table) File "/home/alan/web2py/gluon/dal.py", line 1830, in lastrowid self.execute("select currval('%s')" % table._sequence_name) File "/home/alan/web2py/gluon/dal.py", line 1309, in execute return self.log_execute(*a, **b) File "/home/alan/web2py/gluon/dal.py", line 1304, in log_execute ret = self.cursor.execute(*a,**b) psycopg2.ProgrammingError: relation "debugging_id_seq" does not exist LÍNEA 1: select currval('debugging_id_Seq') ^ Where debugging is a table defined in the model and debugging_id is the id field Maybe there is some conflict with auto generated web2py sql and the db engine I think that this has something to do with this thread on PostgeSQL and quotes: http://groups.google.com/group/web2py/browse_thread/thread/e894189f9b532b75/5d248791cd55c4d1 Thank you