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 ON [[database.]schema.]table IS ... {'comment' | NULL };
Parameters
constraint |
The name of the constraint associated with the comment. |
[database.]schema |
Specifies a schema, by default myschema.thisDbObject If you specify a database, it must be the current database. |
table |
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. |
NULL |
Removes an existing comment. |
Privileges
Non-superuser: object owner
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 example removes a comment from the constraint_x
constraint on the promotion_dimension table:
=> COMMENT ON CONSTRAINT constraint_x ON promotion_dimension IS NULL;