Skip to content

Commit

Permalink
Update COMMENT ON docs for types
Browse files Browse the repository at this point in the history
Fixes DOC-10455
  • Loading branch information
rmloveland committed Jul 24, 2024
1 parent 9b075a6 commit d6cc2cc
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/current/v24.2/comment-on.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: COMMENT ON
summary: The COMMENT ON statement associates comments to databases, tables, columns, or indexes.
summary: The COMMENT ON statement associates comments to databases, tables, columns, indexes, or types.
toc: true
docs_area: reference.sql
---

The `COMMENT ON` [statement]({% link {{ page.version.version }}/sql-statements.md %}) associates comments to [databases]({% link {{ page.version.version }}/create-database.md %}), [tables]({% link {{ page.version.version }}/create-table.md %}), [columns]({% link {{ page.version.version }}/alter-table.md %}#add-column), or [indexes]({% link {{ page.version.version }}/indexes.md %}).
The `COMMENT ON` [statement]({% link {{ page.version.version }}/sql-statements.md %}) associates comments to [databases]({% link {{ page.version.version }}/create-database.md %}), [tables]({% link {{ page.version.version }}/create-table.md %}), [columns]({% link {{ page.version.version }}/alter-table.md %}#add-column), [indexes]({% link {{ page.version.version }}/indexes.md %}), or [types]({% link {{page.version.version}}/show-types.md %}).

{% include {{ page.version.version }}/misc/schema-change-stmt-note.md %}

Expand All @@ -25,6 +25,7 @@ The user must have the `CREATE` [privilege]({% link {{ page.version.version }}/s
------------|--------------
`database_name` | The name of the [database]({% link {{ page.version.version }}/create-database.md %}) on which you are commenting.
`schema_name` | The name of the [schema]({% link {{ page.version.version }}/create-schema.md %}) on which you are commenting.
`type_name` | The name of the [type]({% link {{ page.version.version }}/show-types.md %}) on which you are commenting.
`table_name` | The name of the [table]({% link {{ page.version.version }}/create-table.md %}) on which you are commenting.
`column_name` | The name of the [column]({% link {{ page.version.version }}/alter-table.md %}#add-column) on which you are commenting.
`table_index_name` | The name of the [index]({% link {{ page.version.version }}/indexes.md %}) on which you are commenting.
Expand Down Expand Up @@ -180,6 +181,22 @@ To view column comments, use [`SHOW INDEXES ... WITH COMMENT`]({% link {{ page.v
(8 rows)
~~~

### Add a comment to a type

Suppose we [create a type]({% link {{ page.version.version }}/create-type.md %}):

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE TYPE IF NOT EXISTS my_point AS (x FLOAT, y FLOAT, z FLOAT);
~~~

{% include_cached copy-clipboard.html %}
~~~ sql
COMMENT ON TYPE my_point IS '3D point';
~~~

[XXX](): how to view the type?

### Remove a comment from a database

To remove a comment from a database:
Expand Down

0 comments on commit d6cc2cc

Please sign in to comment.