From a1ad6e65cd8fbf02ceb5c84e4b5de9876cc03e4d Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Wed, 21 Oct 2026 04:12:55 +0700 Subject: [PATCH 1/2] docs(features): PostgreSQL sequences in the sidebar, Set Next Value and Edit Sequence --- databases/mariadb.mdx | 2 +- databases/postgresql.mdx | 4 ++++ features/table-operations.mdx | 19 +++++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/databases/mariadb.mdx b/databases/mariadb.mdx index 56846202..7e4b9f30 100644 --- a/databases/mariadb.mdx +++ b/databases/mariadb.mdx @@ -23,7 +23,7 @@ mariadb://user:password@localhost/database?socket=%2Ftmp%2Fmysql.sock - Virtual and persistent columns are detected on every version, including the bare `VIRTUAL` and `PERSISTENT` spelling that 10.1 and older report, and are left out of generated INSERT and UPDATE statements. - A query timeout goes in as `SET SESSION max_statement_time`, counted in seconds. MySQL takes `max_execution_time` in milliseconds. - 10.2.1 to 10.2.21 and 10.3.0 to 10.3.9 enforce check constraints without publishing an `information_schema.CHECK_CONSTRAINTS` to read them from. The [Constraints tab](/features/table-structure#constraints-tab) takes them out of `SHOW CREATE TABLE` on those releases and out of the catalog everywhere else. -- Sequences appear in the sidebar's Tables section as their own kind, read-only, with **Drop Sequence** on the menu. See [Sequences and system-versioned tables](/features/table-operations#sequences-and-system-versioned-tables). +- Sequences appear in the sidebar's **Sequences** section, read-only, with **Drop Sequence** on the menu. See [Sequences](/features/table-operations#sequences). - A table declared `WITH SYSTEM VERSIONING` is listed as an ordinary table and loses **Truncate** alone, which the server refuses with error 4137. - A temporary table shadowing a base table of the same name is left out of the listing, so the name appears once. diff --git a/databases/postgresql.mdx b/databases/postgresql.mdx index b1b5525c..4e2cdaae 100644 --- a/databases/postgresql.mdx +++ b/databases/postgresql.mdx @@ -102,6 +102,10 @@ A value the list cannot represent opens the text editor instead: a multi-dimensi `box[]` is the one column whose elements are not separated by a comma. PostgreSQL uses a semicolon there, because a box's own text contains commas, and the list reads it that way. +## Sequences + +Each schema lists its sequences under **Sequences**, with the owning column on hover. **Set Next Value…** realigns a sequence with the highest value in its column, and **Edit Sequence…** changes its increment, bounds, cache and cycling. See [Sequences](/features/table-operations#sequences). + ## User-defined types Enums, composites, domains and ranges are listed under **Types** in each schema, the `CREATE` statement rebuilt from `pg_type`. The structure editor's type picker offers the schema's types under **User-Defined**. See [User-Defined Types](/features/user-defined-types). diff --git a/features/table-operations.mdx b/features/table-operations.mdx index 6e93ea85..dc6aa156 100644 --- a/features/table-operations.mdx +++ b/features/table-operations.mdx @@ -111,9 +111,24 @@ Comments are edited per object. Right-click a table or view and choose **Edit Co Engines installed as plugins need their latest plugin version. -## Sequences and system-versioned tables +## Sequences -A MariaDB sequence carries a number icon in the sidebar and reads as **Sequence**. It is a read-only kind, so its menu drops **Truncate** and **Import**, the drop item reads **Drop Sequence**, and the Structure tab offers no edit. MariaDB refuses `UPDATE`, `DELETE` and `TRUNCATE` on one with error 1031, and `ALTER TABLE … ADD COLUMN` with error 4086. Rename still works, through `RENAME TABLE`. Read the current value with `SELECT * FROM seq_name`, and change it with `SETVAL` in the query editor. +PostgreSQL and MariaDB sequences are listed under **Sequences** in each schema, with a number icon. Hover one to see the column that owns it, such as `orders.id` for a `serial` or identity column. The sidebar filter and Open Quickly find sequences by name. + +Double-click a sequence to open it. On PostgreSQL the grid shows `last_value`, `log_cnt` and `is_called`, and the DDL tab of **Show Structure** holds the `CREATE SEQUENCE` statement with the data type, start, increment, minimum, maximum and cache, followed by `OWNED BY` and the `setval` that restores its position. On MariaDB the grid shows every setting. + +A sequence is a read-only kind: its menu drops **Truncate** and **Import**, the Structure tab offers no edit, and the drop item reads **Drop Sequence**. **Rename** works on both engines. + +On PostgreSQL, right-click a sequence for two more commands, also under **Database > Set Next Value…** and **Database > Edit Sequence…**: + +- **Set Next Value…** sets what the next `nextval` returns. For a sequence a column owns, **After the values already in** moves it one step past that column's highest value, or its lowest for a descending sequence, which repairs a sequence that fell behind its table after a bulk load or a restore. It never moves a sequence back, and it holds inserts into the table until it is done. To move a sequence back, type the value. +- **Edit Sequence…** shows the data type, start, last value and owner, and changes the increment, minimum, maximum, cache and cycling through `ALTER SEQUENCE`. + +Both sheets show the SQL before it runs and go through [Safe Mode](/features/safe-mode). **New Sequence…** under the **+** button at the foot of the sidebar, or **Database > New Sequence…**, opens a `CREATE SEQUENCE` template in a query tab. + +MariaDB refuses `UPDATE`, `DELETE` and `TRUNCATE` on a sequence with error 1031, and `ALTER TABLE … ADD COLUMN` with error 4086. Rename goes through `RENAME TABLE`. Change a MariaDB sequence's value with `SETVAL` in the query editor. + +## System-versioned tables A MariaDB table declared `WITH SYSTEM VERSIONING` stays an ordinary table: row editing, **Import**, index edits, comments, rename and drop all work. **Truncate** alone is withheld, because the server refuses it with error 4137. Delete the history with `DELETE HISTORY FROM table_name` instead. On iPhone and iPad the listing reports such a table as a plain one, so **Truncate** is offered there and the server's refusal comes back as an alert. From f279d2a6b22ac2188d3f1df7b68d66683aad782c Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Wed, 21 Oct 2026 04:21:55 +0700 Subject: [PATCH 2/2] docs(features): Edit Sequence shows the next value --- features/table-operations.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/table-operations.mdx b/features/table-operations.mdx index dc6aa156..bb7e0e37 100644 --- a/features/table-operations.mdx +++ b/features/table-operations.mdx @@ -122,7 +122,7 @@ A sequence is a read-only kind: its menu drops **Truncate** and **Import**, the On PostgreSQL, right-click a sequence for two more commands, also under **Database > Set Next Value…** and **Database > Edit Sequence…**: - **Set Next Value…** sets what the next `nextval` returns. For a sequence a column owns, **After the values already in** moves it one step past that column's highest value, or its lowest for a descending sequence, which repairs a sequence that fell behind its table after a bulk load or a restore. It never moves a sequence back, and it holds inserts into the table until it is done. To move a sequence back, type the value. -- **Edit Sequence…** shows the data type, start, last value and owner, and changes the increment, minimum, maximum, cache and cycling through `ALTER SEQUENCE`. +- **Edit Sequence…** shows the data type, start, next value and owner, and changes the increment, minimum, maximum, cache and cycling through `ALTER SEQUENCE`. Both sheets show the SQL before it runs and go through [Safe Mode](/features/safe-mode). **New Sequence…** under the **+** button at the foot of the sidebar, or **Database > New Sequence…**, opens a `CREATE SEQUENCE` template in a query tab.