Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

ALTER TABLE ... MODIFY COMMENT

이 SQL 문은 이전에 설정되었는지와 관계없이 테이블 주석을 추가, 수정 또는 제거합니다. 주석 변경 사항은 system.tablesSHOW CREATE TABLE 쿼리 모두에 반영됩니다.

구문

ALTER TABLE [db].name [ON CLUSTER cluster] MODIFY COMMENT 'Comment'

예시

주석이 있는 테이블을 생성하려면:

Querysql
CREATE TABLE table_with_comment
(
    `k` UInt64,
    `s` String
)
ENGINE = Memory()
COMMENT 'The temporary table';

테이블 주석을 수정하려면:

Querysql
ALTER TABLE table_with_comment
MODIFY COMMENT 'new comment on a table';

수정된 주석을 확인하려면:

Querysql
SELECT comment
FROM system.tables
WHERE database = currentDatabase() AND name = 'table_with_comment';
Responsetext
┌─comment────────────────┐
│ new comment on a table │
└────────────────────────┘

테이블 주석을 제거하려면:

Querysql
ALTER TABLE table_with_comment MODIFY COMMENT '';

주석이 제거되었는지 확인하려면:

Querysql
SELECT comment
FROM system.tables
WHERE database = currentDatabase() AND name = 'table_with_comment';
Responsetext
┌─comment─┐
│         │
└─────────┘

주의사항

복제된 테이블에서는 주석이 레플리카마다 다를 수 있습니다. 주석을 수정해도 단일 레플리카에만 적용됩니다.

이 기능은 버전 23.9부터 사용할 수 있습니다. 이전 ClickHouse 버전에서는 작동하지 않습니다.

Navigation