COMMENT ON CONSTRAINT

Adds, revises, or removes a comment on a constraint. Each object can have one comment. Comments are stored in the system table COMMENTS.

Syntax

COMMENT ON CONSTRAINT constraint-name ON [ [db-name.]schema.]table-name IS ... {'comment' | NULL };

Parameters

constraint-name

The name of the constraint associated with the comment.

[db-name.]schema

Specifies a schema. If multiple schemas are defined in the database, include the schema name. For example:

myschema.thisDbObject
table-name

Specifies the name of the table constraint with which to associate a comment.

comment

Specifies the comment text to add. If a comment already exists for this constraint, this comment overwrites the previous one.

Comments can be up to 8192 characters in length. If a comment exceeds that limitation, Vertica truncates the comment and alerts the user with a message.

You can enclose a blank value within single quotes to remove an existing comment.

NULL

Removes an existing comment.

Privileges

Example

The following example adds a comment to the constraint_x constraint on the promotion_dimension table:

=> COMMENT ON CONSTRAINT constraint_x ON promotion_dimension IS 'Primary key';

The following examples remove a comment from the constraint_x constraint on the promotion_dimension table:

=> COMMENT ON CONSTRAINT constraint_x ON promotion_dimension IS NULL;
=> COMMENT ON CONSTRAINT constraint_x ON promotion_dimension IS '';