--- test
+++ upgrade.stable.out.int128
@@ -4748,40 +4748,40 @@
         subq LEFT OUTER JOIN tp
         ON subq.m_tid = tp.table_id) AS tmp_pi;
 CREATE VIEW sys.describe_sequences AS
-	SELECT
-		s.name sch,
-		seq.name seq,
-		seq."start" s,
-		peak_next_value_for(s.name, seq.name) rs,
-		CASE WHEN seq."minvalue" = -9223372036854775807 AND seq."increment" > 0 AND seq."start" =  1 THEN TRUE ELSE FALSE END nomin,
-		CASE WHEN seq."maxvalue" =  9223372036854775807 AND seq."increment" < 0 AND seq."start" = -1 THEN TRUE ELSE FALSE END nomax,
-		CASE
-			WHEN seq."minvalue" = 0 AND seq."increment" > 0 THEN NULL
-			WHEN seq."minvalue" <> -9223372036854775807 THEN seq."minvalue"
-			ELSE
-				CASE
-					WHEN seq."increment" < 0  THEN NULL
-					ELSE CASE WHEN seq."start" = 1 THEN NULL ELSE seq."maxvalue" END
-				END
-		END rmi,
-		CASE
-			WHEN seq."maxvalue" = 0 AND seq."increment" < 0 THEN NULL
-			WHEN seq."maxvalue" <> 9223372036854775807 THEN seq."maxvalue"
-			ELSE
-				CASE
-					WHEN seq."increment" > 0  THEN NULL
-					ELSE CASE WHEN seq."start" = -1 THEN NULL ELSE seq."maxvalue" END
-				END
-		END rma,
-		seq."minvalue" mi,
-		seq."maxvalue" ma,
-		seq."increment" inc,
-		seq."cacheinc" cache,
-		seq."cycle" cycle
-	FROM sys.sequences seq, sys.schemas s
-	WHERE s.id = seq.schema_id
-	AND s.name <> 'tmp'
-	ORDER BY s.name, seq.name;
+    SELECT
+        s.name as sch,
+        seq.name as seq,
+        seq."start" s,
+        sys.get_value_for(s.name, seq.name) AS rs,
+        CASE WHEN seq."minvalue" = -9223372036854775807 AND seq."increment" > 0 AND seq."start" =  1 THEN TRUE ELSE FALSE END nomin,
+        CASE WHEN seq."maxvalue" =  9223372036854775807 AND seq."increment" < 0 AND seq."start" = -1 THEN TRUE ELSE FALSE END nomax,
+        CASE
+	         WHEN seq."minvalue" = 0 AND seq."increment" > 0 THEN NULL
+            WHEN seq."minvalue" <> -9223372036854775807 THEN seq."minvalue"
+            ELSE
+                CASE
+                    WHEN seq."increment" < 0  THEN NULL
+                    ELSE CASE WHEN seq."start" = 1 THEN NULL ELSE seq."minvalue" END
+                END
+        END rmi,
+        CASE 
+            WHEN seq."maxvalue" = 0 AND seq."increment" < 0 THEN NULL
+            WHEN seq."maxvalue" <> 9223372036854775807 THEN seq."maxvalue"
+            ELSE
+                CASE
+                    WHEN seq."increment" > 0  THEN NULL
+                    ELSE CASE WHEN seq."start" = -1 THEN NULL ELSE seq."maxvalue" END
+                END
+        END rma,
+        seq."minvalue" mi,
+        seq."maxvalue" ma,
+        seq."increment" inc,
+        seq."cacheinc" cache,
+        seq."cycle" cycle
+    FROM sys.sequences seq, sys.schemas s
+    WHERE s.id = seq.schema_id
+    AND s.name <> 'tmp'
+    ORDER BY s.name, seq.name;
 CREATE VIEW sys.describe_functions AS
     SELECT
         f.id o,
@@ -4925,16 +4925,8 @@
         'CREATE SEQUENCE ' || sys.FQN(sch, seq) || ' AS BIGINT ' ||
         CASE WHEN "s" <> 0 THEN 'START WITH ' || "rs" ELSE '' END ||
         CASE WHEN "inc" <> 1 THEN ' INCREMENT BY ' || "inc" ELSE '' END ||
-        CASE
-            WHEN nomin THEN ' NO MINVALUE'
-            WHEN rmi IS NOT NULL THEN ' MINVALUE ' || rmi
-            ELSE ''
-        END ||
-        CASE
-            WHEN nomax THEN ' NO MAXVALUE'
-            WHEN rma IS NOT NULL THEN ' MAXVALUE ' || rma
-            ELSE ''
-        END ||
+        CASE WHEN "mi" <> 0 THEN ' MINVALUE ' || "mi" ELSE '' END ||
+        CASE WHEN "ma" <> 0 THEN ' MAXVALUE ' || "ma" ELSE '' END ||
         CASE WHEN "cache" <> 1 THEN ' CACHE ' || "cache" ELSE '' END ||
         CASE WHEN "cycle" THEN ' CYCLE' ELSE '' END || ';' stmt
     FROM sys.describe_sequences;
@@ -5765,8 +5757,8 @@
 CREATE VIEW sys.dump_sequences AS
   SELECT
     'CREATE SEQUENCE ' || sys.FQN(sch, seq) || ' AS BIGINT ' ||
-    CASE WHEN "s" <> 0 THEN 'START WITH ' || "rs" ELSE '' END ||
-    CASE WHEN "inc" <> 1 THEN ' INCREMENT BY ' || "inc" ELSE '' END ||
+    CASE WHEN  "s " <> 0 THEN 'START WITH ' ||  "rs " ELSE '' END ||
+    CASE WHEN  "inc " <> 1 THEN ' INCREMENT BY ' ||  "inc " ELSE '' END ||
     CASE
       WHEN nomin THEN ' NO MINVALUE'
       WHEN rmi IS NOT NULL THEN ' MINVALUE ' || rmi
@@ -5777,8 +5769,8 @@
       WHEN rma IS NOT NULL THEN ' MAXVALUE ' || rma
       ELSE ''
     END ||
-    CASE WHEN "cache" <> 1 THEN ' CACHE ' || "cache" ELSE '' END ||
-    CASE WHEN "cycle" THEN ' CYCLE' ELSE '' END ||
+    CASE WHEN  "cache " <> 1 THEN ' CACHE ' ||  "cache " ELSE '' END ||
+    CASE WHEN  "cycle " THEN ' CYCLE' ELSE '' END ||
     ';' stmt,
     sch schema_name,
     seq seqname