Occurs when inserting data to Postgres using Webpy's Db.insert ()
traceback (most recent call last): file "upgrade2.0.py", line 170, in <module> copy_webservice () File "upgrade2.0.py" , line 165, in copy_webservice db36.insert (' Top_node_location ', **r) File "/usr/lib/python2.7/site-packages/web/db.py", line 777, in insert self._db_execute (db_cursor, sql_query) File "/usr/lib /python2.7/site-packages/web/db.py ", line 587, in _db_execute out = cur.execute (query, params) File "/usr/lib/python2.7/site-packages/dbutils/ steadydb.py ", line 631, in tough_method raise error # reraise the original error againpsycopg2. operationalerror: error: in this session sequence "top_node_location_id_seq " currval is still not defined
Find/lib/python2.7/site-packages/web/db.py
Def _process_insert_query (self, query, tablename, seqname): if seqname is None: # when seqname Is not provided guess the seqname and make sure it exists seqname = tablename + "_id_seq" if seqname not in self._get_all_sequences (): seqname = None if seqname: # Comment out this sentence #query += "; select currval ('%s ')" % seqname pass rEturn query
The reason is that when webpy inserts, there is an extra select that uses Currval to get the current sequence value, but Currval () is not supported in postgres9.3.
It seems that the Webpy author died, and there was no update maintenance