COMMENT ON associates comments to , , , or .
The “ statement performs a schema change. For more information about how online schema changes work in CockroachDB, see .
Required privileges
The user must have theCREATE on the object they are commenting on.
Synopsis
Parameters
| Parameter | Description |
|---|---|
database_name | The name of the on which you are commenting. |
schema_name | The name of the on which you are commenting. |
table_name | The name of the on which you are commenting. |
column_name | The name of the on which you are commenting. |
table_index_name | The name of the on which you are commenting. |
comment_text | The comment () you are associating to the object. You can remove a comment by replacing the string with NULL. |
Examples
Setup
The following examples use MovR, a fictional vehicle-sharing application, to demonstrate CockroachDB SQL statements. For more information about the MovR example application and dataset, see . To follow along, run to start a temporary, in-memory cluster with themovr dataset preloaded:
Add a comment to a database
To add a comment to a database:Add a comment to a table
To add a comment to a table:Add a comment to a column
To add a comment to a column:Add a comment to an index
Suppose we on thename column of the users table:

