--- test
+++ upgrade.stable.out.int128
@@ -4681,7 +4681,27 @@
         s.name as sch,
         seq.name as seq,
         seq."start" s,
-        sys.peak_next_value_for(s.name, seq.name) AS rs,
+        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,
@@ -4834,8 +4854,16 @@
         '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 "mi" <> 0 THEN ' MINVALUE ' || "mi" ELSE '' END ||
-        CASE WHEN "ma" <> 0 THEN ' MAXVALUE ' || "ma" 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 "cache" <> 1 THEN ' CACHE ' || "cache" ELSE '' END ||
         CASE WHEN "cycle" THEN ' CYCLE' ELSE '' END || ';' stmt
     FROM sys.describe_sequences;
@@ -5450,6 +5478,19 @@
 		JOIN sys.function_types ft ON f.type = ft.function_type_id
 		LEFT OUTER JOIN sys.function_languages fl ON f.language = fl.language_id
 	WHERE s.name <> 'tmp' AND NOT f.system;
+GRANT SELECT ON sys.describe_constraints TO PUBLIC;
+GRANT SELECT ON sys.describe_indices TO PUBLIC;
+GRANT SELECT ON sys.describe_column_defaults TO PUBLIC;
+GRANT SELECT ON sys.describe_foreign_keys TO PUBLIC;
+GRANT SELECT ON sys.describe_tables TO PUBLIC;
+GRANT SELECT ON sys.describe_triggers TO PUBLIC;
+GRANT SELECT ON sys.describe_comments TO PUBLIC;
+GRANT SELECT ON sys.fully_qualified_functions TO PUBLIC;
+GRANT SELECT ON sys.describe_privileges TO PUBLIC;
+GRANT SELECT ON sys.describe_user_defined_types TO PUBLIC;
+GRANT SELECT ON sys.describe_partition_tables TO PUBLIC;
+GRANT SELECT ON sys.describe_sequences TO PUBLIC;
+GRANT SELECT ON sys.describe_functions TO PUBLIC;
 update sys.functions set system = true where system <> true and name in ('sq', 'fqn', 'get_merge_table_partition_expressions', 'get_remote_table_expressions', 'schema_guard') and schema_id = 2000 and type = 1;
 update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_functions') AND schema_id = 2000;
 CREATE VIEW sys.dump_create_roles AS