changeset 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 302c797756e6
children 4d3b371ed543
files CHANGES.txt roundup/backends/back_postgresql.py
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Sun Jan 19 19:29:17 2025 -0500
+++ b/CHANGES.txt	Sun Jan 19 19:37:48 2025 -0500
@@ -81,6 +81,10 @@
   date input. Also add double-click and exit keyboard handlers to
   allow copy/paste/editing the text version of the date.  (John
   Rouillard)
+- 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. John Rouillard committed)
 
 Features:
 
--- a/roundup/backends/back_postgresql.py	Sun Jan 19 19:29:17 2025 -0500
+++ b/roundup/backends/back_postgresql.py	Sun Jan 19 19:37:48 2025 -0500
@@ -548,7 +548,7 @@
         return str(self.cursor.fetchone()[0])
 
     def setid(self, classname, setid):
-        sql = "select setval('_%s_ids', %s) from dual" % (classname,
+        sql = "select setval('_%s_ids', %s, false) from dual" % (classname,
                                                           int(setid))
         self.sql(sql)
 

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