Skip to content

Commit 1317e5a

Browse files
committed
Change the logic of setval function, so that the next nextval of sequence will return exactly the specified value. #3273
1 parent 1e00611 commit 1317e5a

File tree

7 files changed

+11
-4
lines changed

7 files changed

+11
-4
lines changed

docs/en_US/release_notes_9_0.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ Bundled PostgreSQL Utilities
2020
New features
2121
************
2222

23+
2324
| `Issue #6513 <https://github.com/pgadmin-org/pgadmin4/issues/6513>`_ - Change button labels and color in delete confirmation dialog for all objects to improve UX.
2425
| `Issue #7708 <https://github.com/pgadmin-org/pgadmin4/issues/7708>`_ - Enhanced pgAdmin 4 with support for Workspace layouts.
2526
| `Issue #8332 <https://github.com/pgadmin-org/pgadmin4/issues/8332>`_ - Added the MAINTAIN privilege for PostgreSQL version 17 and above.
27+
| `Issue #8391 <https://github.com/pgadmin-org/pgadmin4/issues/8391>`_ - Add support for OAuth2 profile array response, which also takes care of the GitHub Private Email ID issue.
2628
2729
Housekeeping
2830
************
@@ -32,6 +34,7 @@ Housekeeping
3234
Bug fixes
3335
*********
3436

37+
| `Issue #3273 <https://github.com/pgadmin-org/pgadmin4/issues/3273>`_ - Change the logic of setval function, so that the next nextval of sequence will return exactly the specified value.
3538
| `Issue #5204 <https://github.com/pgadmin-org/pgadmin4/issues/5204>`_ - Fixed an issue where pgadmin cannot install into path with non ASCII characters.
3639
| `Issue #6044 <https://github.com/pgadmin-org/pgadmin4/issues/6044>`_ - Fixed an issue where filter dialog save fails when the PostgreSQL server/database connection is lost.
3740
| `Issue #6968 <https://github.com/pgadmin-org/pgadmin4/issues/6968>`_ - Fixed an issue where option key was not registering in PSQL tool.

docs/en_US/sequence_dialog.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Click the *Definition* tab to continue.
3535

3636
Use the fields in the *Definition* tab to define the sequence:
3737

38+
* Use the *Current Value* field to specify the sequence object\'s current value.
39+
The next nextval will return exactly the specified value, and sequence advancement
40+
commences with the following nextval. *This field is only available in the edit mode*.
3841
* Use the *Increment* field to specify which value is added to the current
3942
sequence value to create a new value.
4043
* Provide a value in the *Start* field to specify the beginning value of the

web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.ui.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export default class SequenceSchema extends BaseUISchema {
136136
}, {
137137
id: 'current_value', label: gettext('Current value'), type: 'int',
138138
mode: ['properties', 'edit'], group: gettext('Definition'),
139+
helpMessage: gettext('Sets the sequence object\'s current value. The next nextval will return exactly the specified value, and sequence advancement commences with the following nextval.')
139140
}, {
140141
id: 'increment', label: gettext('Increment'), type: 'int',
141142
mode: ['properties', 'create', 'edit'], group: gettext('Definition'),

web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/15_plus/update.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ALTER SEQUENCE IF EXISTS {{ conn|qtIdent(o_data.schema, data.name) }}
2020
{% endif %}
2121
{% if data.current_value is defined %}
2222
{% set seqname = conn|qtIdent(o_data.schema, data.name) %}
23-
SELECT setval({{ seqname|qtLiteral(conn) }}, {{ data.current_value }}, true);
23+
SELECT setval({{ seqname|qtLiteral(conn) }}, {{ data.current_value }}, false);
2424

2525
{% endif %}
2626
{% if data.relpersistence in [True, False] and data.relpersistence != o_data.relpersistence %}

web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/update.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ALTER SEQUENCE IF EXISTS {{ conn|qtIdent(o_data.schema, data.name) }}
2020
{% endif %}
2121
{% if data.current_value is defined %}
2222
{% set seqname = conn|qtIdent(o_data.schema, data.name) %}
23-
SELECT setval({{ seqname|qtLiteral(conn) }}, {{ data.current_value }}, true);
23+
SELECT setval({{ seqname|qtLiteral(conn) }}, {{ data.current_value }}, false);
2424

2525
{% endif %}
2626
{% set defquery = '' %}

web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props_msql.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SELECT setval(E'public."Seq1_$%{}[]()&*^!@""''`\\/#"', 7, true);
1+
SELECT setval(E'public."Seq1_$%{}[]()&*^!@""''`\\/#"', 7, false);
22

33
ALTER SEQUENCE IF EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
44
INCREMENT 12

web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_props_msql.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SELECT setval(E'public."Seq1_$%{}[]()&*^!@""''`\\/#"', 7, true);
1+
SELECT setval(E'public."Seq1_$%{}[]()&*^!@""''`\\/#"', 7, false);
22

33
ALTER SEQUENCE IF EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
44
INCREMENT 12

0 commit comments

Comments
 (0)