Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

ALTER TABLE ... MODIFY COMMENT

يضيف تعليقًا إلى جدول أو يعدّله أو يزيله، سواء أكان مُعيَّنًا سابقًا أم لا. ينعكس تغيير التعليق في كلٍّ من system.tables وفي استعلام SHOW 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─┐
│         │
└─────────┘

ملاحظات مهمة

بالنسبة إلى الجداول Replicated، قد يختلف التعليق من نسخة متماثلة إلى أخرى. يسري تعديل التعليق على نسخة متماثلة واحدة فقط.

تتوفّر هذه الميزة بدءًا من الإصدار 23.9. وهي لا تعمل في إصدارات ClickHouse الأقدم.

Navigation