Skip to main content
Enterprise only
Use a table tag to give an existing table version a name, such as release-1. These SQL statements manage the same tags as the table SDK and REST API. They require an Enterprise server with SQL table tag support.

Syntax

Tag names are single-quoted strings. Version numbers must be positive integers that identify existing table versions; the first version is 1. An unqualified table name uses the session’s database and namespace. To choose a different namespace or database, qualify the table name:

Branch scope

CREATE TAG and ALTER TAG resolve version numbers on the table’s main branch. The SQL syntax has no branch selector. SHOW TAGS lists all tags for the table, including tags associated with other branches; its branch column identifies those tags. DROP TAG removes the named tag regardless of its branch.

Privileges

The caller needs access to the table’s database and namespace, plus the table privilege for the requested statement:

Create a tag

Assuming events already has version 42, name that version release-1:
Creating a tag fails if the name already exists or the version does not exist. Use a new name or move the existing tag with ALTER TAG.

Move a tag

Point an existing tag at another version on the main branch:
The tag and version 57 must already exist. Moving a tag changes the version it names without changing the table’s data.

Drop a tag

Remove a tag when its name is no longer needed:
Dropping a tag removes its name without dropping the table or its version. The statement fails if the tag does not exist. Successful CREATE TAG, ALTER TAG, and DROP TAG statements return one row with operation, name, and status columns. name is the tag name, and status is created, updated, or dropped, respectively.

List tags

The result has one row per tag, sorted by tag name. A table with no tags returns zero rows with the same columns: