comparison roundup/backends/back_postgresql.py @ 8295:bbc99def147a

fix: issue2550815 - roundup-admin import for postgres causes id to be skipped. Fixed code so that the id used to set the sequence will be returned and not skipped. (Tom Ekberg diagnosed and supplied the fix.)
author John Rouillard <rouilj@ieee.org>
date Sun, 19 Jan 2025 19:37:48 -0500
parents 8147f6deac9f
children cfa7d43a3658
comparison
equal deleted inserted replaced
8294:302c797756e6 8295:bbc99def147a
546 sql = "select nextval('_%s_ids') from dual" % classname 546 sql = "select nextval('_%s_ids') from dual" % classname
547 self.sql(sql) 547 self.sql(sql)
548 return str(self.cursor.fetchone()[0]) 548 return str(self.cursor.fetchone()[0])
549 549
550 def setid(self, classname, setid): 550 def setid(self, classname, setid):
551 sql = "select setval('_%s_ids', %s) from dual" % (classname, 551 sql = "select setval('_%s_ids', %s, false) from dual" % (classname,
552 int(setid)) 552 int(setid))
553 self.sql(sql) 553 self.sql(sql)
554 554
555 def clear(self): 555 def clear(self):
556 rdbms_common.Database.clear(self) 556 rdbms_common.Database.clear(self)

Roundup Issue Tracker: http://roundup-tracker.org/